woocommerce/plugins/woocommerce-admin/tests/e2e/models/onboarding/ThemeSection.ts

24 lines
506 B
TypeScript

import { Page } from 'puppeteer';
import { getElementByText, waitForElementByText } from '../../utils/actions';
export class ThemeSection {
page: Page;
constructor( page: Page ) {
this.page = page;
}
async isDisplayed() {
await waitForElementByText( 'h2', 'Choose a theme' );
await waitForElementByText( 'button', 'All themes' );
}
async continueWithActiveTheme() {
const button = await getElementByText(
'button',
'Continue with my active theme'
);
await button?.click();
}
}