diff --git a/tests/browser-automated-tests-playwright/delete-connect-account-id.js b/tests/browser-automated-tests-playwright/delete-connect-account-id.js new file mode 100644 index 000000000..178601b93 --- /dev/null +++ b/tests/browser-automated-tests-playwright/delete-connect-account-id.js @@ -0,0 +1,27 @@ +// global-setup.js +const { test, expect, chromium } = require('@playwright/test'); + +module.exports = async config => { + const { baseURL, storageState } = config.projects[0].use; + const browser = await chromium.launch(); + const page = await browser.newPage(); + await page.goto(baseURL + '/auth/login'); + await page.fill('#email', 'admin@example.com'); + await page.fill('#password', 'password'); + await page.click('#login'); + + const content = await page.textContent('.card-title') + expect(content === 'Checklist'); // If we see "Checklist", we're logged in to admin + + await new Promise(x => setTimeout(x, 5000)); + await page.goto(baseURL + '/admin/delete-connect-account'); + console.log('deleting-connect-account-id'); + await new Promise(x => setTimeout(x, 2000)); //2 secconds + await page.goto(baseURL + 'admin/dashboard') + const connect_to_stripe = await page.textContent('text="Review Stripe"'); + expect (connect_to_stripe == 'Review Stripe'); + console.log('stripe is not connected'); + + await page.context().storageState({ path: storageState }); + await browser.close(); +}; diff --git a/tests/browser-automated-tests-playwright/tests/delete-connect-account-id.js b/tests/browser-automated-tests-playwright/tests/delete-connect-account-id.js deleted file mode 100644 index c3aa3aec5..000000000 --- a/tests/browser-automated-tests-playwright/tests/delete-connect-account-id.js +++ /dev/null @@ -1,12 +0,0 @@ -const { test, expect } = require('@playwright/test'); -// Clear connect account id after all tests are completed -test("@831@delete-connect-account-id", async ({ page }) => { - - await page.goto('/admin/delete-connect-account'); - await new Promise(x => setTimeout(x, 2000)); //2 secconds - await page.goto('admin/dashboard') - const connect_to_stripe = await page.textContent('text="Review Stripe"'); - expect (connect_to_stripe == 'Review Stripe'); - - -});