woocommerce/plugins/woocommerce-admin/tests/e2e/sections/onboarding/IndustrySection.ts

29 lines
717 B
TypeScript
Raw Normal View History

import { BasePage } from '../../pages/BasePage';
import { waitForElementByText } from '../../utils/actions';
export class IndustrySection extends BasePage {
async isDisplayed( industryCount?: number ) {
await waitForElementByText(
'h2',
'In which industry does the store operate?'
);
if ( industryCount ) {
const length = await this.page.$$eval(
'.components-checkbox-control__input',
( items ) => items.length
);
expect( length === industryCount ).toBeTruthy();
}
}
async uncheckIndustries() {
await this.unsetAllCheckboxes( '.components-checkbox-control__input' );
}
async selectIndustry( industryLabel: string ) {
await this.setCheckboxWithLabel( industryLabel );
}
}