-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: e2e fixes #2467
tests: e2e fixes #2467
Conversation
@@ -18,8 +18,8 @@ jobs: | |||
node-version: '10.16.0' | |||
- run: npm ci | |||
- run: npm install jest --global | |||
- run: npm run dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this down, after test:e2e-docker-up
, because the test:e2e-docker-up
might take a while. While that's completing, we can build the package in the meantime.
This should save us some time on the duration of the workflow, as well as reduce errors while calling test:e2e-docker-ping
await StoreOwnerFlow.openExistingOrderPage( order.id ); | ||
|
||
await clickReactButton( '.ellipsis-menu > .button' ); | ||
await clickReactButton( 'div > .popover > .popover__inner > .popover__menu > .popover__menu-item:nth-child(3)' ); | ||
await clickReactButton( '.ReactModalPortal > .ReactModal__Overlay > .ReactModal__Content > .dialog__action-buttons > .button:nth-child(2)' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm puzzled by the old behavior - the newLabelButton
is not present to create a shipping label; and the purchase flow does not present a "purchase" button, but it requires the whole address verification and package purchase.
So I'm deleting this, we're just verifying that the refund process works.
|
||
const verifyAndPublish = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used anywhere
/** | ||
* Create simple product. | ||
*/ | ||
const createSimpleProduct = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used anywhere
/** | ||
* Login and confirm that extension is activated on the site. | ||
*/ | ||
const loginAndConfirmExtensionActivation = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used anywhere
@@ -1,21 +1,40 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space should not be valid here, I don't think
@@ -1,9 +0,0 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not needed - it's residual from when we used Travis CI
@@ -1,10 +1,8 @@ | |||
const { useE2EJestPuppeteerConfig } = require( '@woocommerce/e2e-environment' ); | |||
|
|||
const puppeteerConfig = useE2EJestPuppeteerConfig( { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just inlined this, no need to have another const
define( 'WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE', true ); | ||
define( 'WOOCOMMERCE_CONNECT_FREQUENT_FETCH', true ); | ||
define( 'WOOCOMMERCE_CONNECT_SERVER_URL', 'http://host.docker.internal:5000/' ); | ||
define( 'WOOCOMMERCE_SERVICES_CI_TEST_MODE', true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed when WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE
and JETPACK_DEV_DEBUG
are already specified:
woocommerce-services/woocommerce-services.php
Lines 52 to 59 in ea71f8f
if ( false !== getenv( 'WOOCOMMERCE_SERVICES_CI_TEST_MODE' ) ) { | |
if ( ! defined( 'WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE' ) ) { | |
define( 'WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE', true ); | |
} | |
if ( ! defined( 'JETPACK_DEV_DEBUG' ) ) { | |
define( 'JETPACK_DEV_DEBUG', true ); | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this PR, these are also now set in tests/bin/install.sh
Adding next PR reviewer on rotation |
👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E2E tests passes. LGTM 👍
Description
Fixing the e2e tests.
The main issue here was that the
@woocommerce/e2e-environment
was outdated.It took me a while to figure it out with my local, because my local was not configured correctly.
In the end, it can be summarized with this statement:
And this PR: woocommerce/woocommerce#29346
With this fix, the e2e started (properly) failing.
It turns out, some of the selector names changed because we migrated away from Calypso. So I fixed those too.
Related issue(s)
Trying to fix #2454
Steps to reproduce & screenshots/GIFs
npm run test:e2e-dev
(or just notice that they're now passing in the GH actions below 👇 )Checklist
changelog.txt
entry added