From b856a2648ceaf8cdc2d2d0c8b8cb9d974f6a69c7 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:16:24 -0700 Subject: [PATCH] test: reduce page loads in project-page.test.js --- test/integration/project-page.test.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/integration/project-page.test.js b/test/integration/project-page.test.js index d9dc82b89..eea1a3d47 100644 --- a/test/integration/project-page.test.js +++ b/test/integration/project-page.test.js @@ -123,10 +123,6 @@ describe('www-integration project-page signed in', () => { await findByXpath('//span[contains(@class, "profile-name")]'); }); - beforeEach(async () => { - await driver.get(rootUrl); - }); - afterAll(() => driver.quit()); // LOGGED in TESTS @@ -191,7 +187,6 @@ describe('www-integration project-creation signed in', () => { // expect(projectUrl).toBe(defined); driver = await buildDriver('www-integration project-creation signed in'); await driver.get(rootUrl); - await driver.sleep(1000); await signIn(username, password); await findByXpath('//span[contains(@class, "profile-name")]'); @@ -199,15 +194,11 @@ describe('www-integration project-creation signed in', () => { // https://support.saucelabs.com/hc/en-us/articles/115003685593-Uploading-Files-to-a-Sauce-Labs-Virtual-Machine-during-a-Test if (remote) { await driver.get('https://github.com/scratchfoundation/scratch-www/blob/develop/test/fixtures/project1.sb3'); - await clickXpath('//Button[@data-testid="download-raw-button"]'); + await clickXpath('//button[@data-testid="download-raw-button"]'); await driver.sleep(3000); } }); - beforeEach(async () => { - await driver.get(rootUrl); - }); - afterAll(() => driver.quit()); test('make a copy of a project', async () => { @@ -240,6 +231,9 @@ describe('www-integration project-creation signed in', () => { }); test('load project from file', async () => { + // load the editor without making a new project + await driver.get(unownedSharedUrl); + // if remote, projectPath is Saucelabs path to downloaded file const projectPath = remote ? '/Users/chef/Downloads/project1.sb3' :