diff --git a/test/integration/project-loading.test.js b/test/integration/project-loading.test.js index 7d857c286ade13c9fe5d831b57cc42a1de945a29..b11a5bf594d6bd35bf68202bce1c9b3bf0a34cd0 100644 --- a/test/integration/project-loading.test.js +++ b/test/integration/project-loading.test.js @@ -4,6 +4,7 @@ import SeleniumHelper from '../helpers/selenium-helper'; const { clickText, clickXpath, + findByText, findByXpath, getDriver, getLogs, @@ -31,7 +32,9 @@ describe('Loading scratch gui', () => { await clickText('Oops! Something went wrong.'); }); - test('Load a project by ID directly through url', async () => { + // skipping because it relies on network speed, and tests a method + // of loading projects that we are not actively using anymore + test.skip('Load a project by ID directly through url', async () => { await driver.quit(); // Reset driver to test hitting # url directly driver = getDriver(); @@ -44,7 +47,9 @@ describe('Loading scratch gui', () => { await expect(logs).toEqual([]); }); - test('Load a project by ID (fullscreen)', async () => { + // skipping because it relies on network speed, and tests a method + // of loading projects that we are not actively using anymore + test.skip('Load a project by ID (fullscreen)', async () => { await driver.quit(); // Reset driver to test hitting # url directly driver = getDriver(); @@ -73,7 +78,6 @@ describe('Loading scratch gui', () => { test('Creating new project resets active tab to Code tab', async () => { await loadUri(uri); - await new Promise(resolve => setTimeout(resolve, 2000)); await findByXpath('//*[span[text()="Costumes"]]'); await clickText('Costumes'); await clickXpath( @@ -81,13 +85,12 @@ describe('Loading scratch gui', () => { 'contains(@class, "menu-bar_hoverable")][span[text()="File"]]' ); await clickXpath('//li[span[text()="New"]]'); - await findByXpath('//*[div[@class="scratchCategoryMenu"]]'); + await findByXpath('//div[@class="scratchCategoryMenu"]'); await clickText('Operators', scope.blocksTab); }); test('Not logged in->made no changes to project->create new project should not show alert', async () => { await loadUri(uri); - await new Promise(resolve => setTimeout(resolve, 2000)); await clickXpath( '//div[contains(@class, "menu-bar_menu-bar-item") and ' + 'contains(@class, "menu-bar_hoverable")][span[text()="File"]]' @@ -99,10 +102,10 @@ describe('Loading scratch gui', () => { test('Not logged in->made a change to project->create new project should show alert', async () => { await loadUri(uri); - await new Promise(resolve => setTimeout(resolve, 2000)); await clickText('Sounds'); await clickXpath('//button[@aria-label="Choose a Sound"]'); await clickText('A Bass', scope.modal); // Should close the modal + await findByText('1.28'); // length of A Bass sound await clickXpath( '//div[contains(@class, "menu-bar_menu-bar-item") and ' + 'contains(@class, "menu-bar_hoverable")][span[text()="File"]]'