Adjust various conditions of the OBW e2e test to make it pass

This commit is contained in:
Julia Amosova 2020-06-17 17:20:12 -04:00
parent 3763d3b428
commit 281057eee8
3 changed files with 10 additions and 22 deletions

View File

@ -27,7 +27,7 @@
"country": "United States (US)",
"addressfirstline": "addr 1",
"addresssecondline": "addr 2",
"countryandstate": "United States (US) -- California",
"countryandstate": "United States (US) California",
"city": "San Francisco",
"state": "CA",
"postcode": "94107"

View File

@ -6,20 +6,17 @@
* Internal dependencies
*/
import { StoreOwnerFlow } from '../../utils/flows';
import { completeOldSetupWizard, completeOnboardingWizard } from '../../utils/components';
import { completeOnboardingWizard } from '../../utils/components';
import {
permalinkSettingsPageSaveChanges,
setCheckbox,
settingsPageSaveChanges,
verifyCheckboxIsSet,
verifyCheckboxIsUnset, verifyValueOfInputField
verifyValueOfInputField
} from '../../utils';
const config = require( 'config' );
describe( 'Store owner can login and make sure WooCommerce is activated', () => {
it( 'can login', async () => {
beforeAll( async () => {
await StoreOwnerFlow.login();
} );
@ -56,25 +53,16 @@ describe( 'Store owner can go through setup Task List', () => {
it( 'can setup shipping', async () => {
// Query for all tasks on the list
const taskListItems = await page.$$( '.woocommerce-list__item-title' );
expect( taskListItems ).toHaveLength( 5 );
expect( taskListItems ).toHaveLength( 6 );
await Promise.all( [
// Click on "Set up shipping" task to move to the next step
taskListItems[2].click(),
taskListItems[3].click(),
// Wait for shipping setup section to load
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
] );
// Query for store location fields
const storeLocationFields = await page.$$( '.components-text-control__input' );
expect( storeLocationFields ).toHaveLength( 4 );
// Wait for "Continue" button to become active
await page.waitForSelector( 'button.is-primary:not(:disabled)' );
// Click on "Continue" button to move to the shipping cost section
await page.click( 'button.is-primary' );
// Wait for "Proceed" button to become active
await page.waitForSelector( 'button.is-primary:not(:disabled)' );
await page.waitFor( 3000 );

View File

@ -121,11 +121,11 @@ const completeOnboardingWizard = async () => {
}
// Wait for "Continue" button to become active
await page.waitForSelector( 'button.woocommerce-profile-wizard__continue:not(:disabled)' );
await page.waitForSelector( 'button.is-primary:not(:disabled)' );
await Promise.all( [
// Click on "Continue" button to move to the next step
page.click( 'button.woocommerce-profile-wizard__continue' ),
page.click( 'button.is-primary' ),
// Wait for "Tell us about your business" section to load
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
@ -186,9 +186,9 @@ const completeOnboardingWizard = async () => {
await page.waitForSelector( '.woocommerce-profile-wizard__header-title' );
// Wait for "No thanks" button to become active
await page.waitForSelector( 'button.is-default:not(:disabled)' );
await page.waitForSelector( 'button.is-secondary:not(:disabled)' );
// Click on "No thanks" button to move to the next step
await page.click( 'button.is-default' );
await page.click( 'button.is-secondary' );
// End of onboarding wizard