Clear browser cache and cookies after each test.
Add merchant logins to relevant onboarding & setup tests
This commit is contained in:
parent
8a7f185652
commit
072af834b9
|
@ -25,7 +25,7 @@ async function trashExistingPosts() {
|
|||
const posts = response.data;
|
||||
|
||||
// Delete each post
|
||||
for(const post of posts){
|
||||
for (const post of posts) {
|
||||
await client.delete(`${wpPostsEndpoint}/${post.id}`);
|
||||
}
|
||||
|
||||
|
@ -34,11 +34,19 @@ async function trashExistingPosts() {
|
|||
// Before every test suite run, delete all content created by the test. This ensures
|
||||
// other posts/comments/etc. aren't dirtying tests and tests don't depend on
|
||||
// each other's side-effects.
|
||||
beforeAll( async () => {
|
||||
beforeAll(async () => {
|
||||
await trashExistingPosts();
|
||||
await withRestApi.deleteAllProducts();
|
||||
await withRestApi.deleteAllCoupons();
|
||||
await page.goto(WP_ADMIN_LOGIN);
|
||||
await clearLocalStorage();
|
||||
await setBrowserViewport( 'large' );
|
||||
} );
|
||||
await setBrowserViewport('large');
|
||||
});
|
||||
|
||||
// Clear browser cookies and cache using DevTools.
|
||||
// This is to ensure that each test ends with no user logged in.
|
||||
afterAll(async () => {
|
||||
const client = await page.target().createCDPSession();
|
||||
await client.send('Network.clearBrowserCookies');
|
||||
await client.send('Network.clearBrowserCache');
|
||||
});
|
||||
|
|
|
@ -24,6 +24,10 @@ const shippingZoneNameUS = config.get( 'addresses.customer.shipping.country' );
|
|||
|
||||
const runOnboardingFlowTest = () => {
|
||||
describe('Store owner can go through store Onboarding', () => {
|
||||
beforeAll(async () => {
|
||||
await merchant.login();
|
||||
});
|
||||
|
||||
if ( IS_RETEST_MODE ) {
|
||||
it('can reset onboarding to default settings', async () => {
|
||||
await withRestApi.resetOnboarding();
|
||||
|
@ -48,6 +52,10 @@ const runOnboardingFlowTest = () => {
|
|||
|
||||
const runTaskListTest = () => {
|
||||
describe('Store owner can go through setup Task List', () => {
|
||||
beforeAll(async () => {
|
||||
await merchant.login();
|
||||
});
|
||||
|
||||
it('can setup shipping', async () => {
|
||||
await page.evaluate(() => {
|
||||
document.querySelector('.woocommerce-list__item-title').scrollIntoView();
|
||||
|
|
|
@ -27,6 +27,9 @@ const {
|
|||
|
||||
const runInitialStoreSettingsTest = () => {
|
||||
describe('Store owner can finish initial store setup', () => {
|
||||
beforeAll(async () => {
|
||||
await merchant.login();
|
||||
});
|
||||
|
||||
it('can enable tax rates and calculations', async () => {
|
||||
// Go to general settings page
|
||||
|
|
Loading…
Reference in New Issue