allow CBD to be optional in business details in E2E (https://github.com/woocommerce/woocommerce-admin/pull/7675)

This commit is contained in:
Ron Rennick 2021-09-17 13:55:29 -03:00 committed by GitHub
parent aed89bfdc5
commit f028d728fa
2 changed files with 9 additions and 3 deletions

View File

@ -5,7 +5,7 @@ import { BasePage } from '../../pages/BasePage';
import { waitForElementByText } from '../../utils/actions';
export class IndustrySection extends BasePage {
async isDisplayed( industryCount?: number ) {
async isDisplayed( industryCount?: number, industryCountMax?: number ) {
await waitForElementByText(
'h2',
'In which industry does the store operate?'
@ -17,7 +17,13 @@ export class IndustrySection extends BasePage {
( items ) => items.length
);
expect( length === industryCount ).toBeTruthy();
if ( industryCountMax ) {
expect(
length >= industryCount && length <= industryCountMax
).toBeTruthy();
} else {
expect( length === industryCount ).toBeTruthy();
}
}
}

View File

@ -48,7 +48,7 @@ const testAdminOnboardingWizard = () => {
it( 'can complete the industry section', async () => {
// Query for the industries checkboxes
await profileWizard.industry.isDisplayed( 8 );
await profileWizard.industry.isDisplayed( 7, 8 );
await profileWizard.industry.uncheckIndustries();
// Select just "fashion" and "health/beauty" to get the single checkbox business section when