diff --git a/test/integration/backdrops.test.js b/test/integration/backdrops.test.js index 9a527b2c9d4caa39287b9566af459648efb6ae7b..09d398bd14a894322306151a4e56baecab1154a5 100644 --- a/test/integration/backdrops.test.js +++ b/test/integration/backdrops.test.js @@ -26,7 +26,6 @@ describe('Working with backdrops', () => { test('Adding a backdrop from the library', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); // Start on the sounds tab of sprite1 to test switching behavior await clickText('Sounds'); diff --git a/test/integration/backpack.test.js b/test/integration/backpack.test.js index cfc78613ccdb6ab4fa71d029842b7df26543b03c..a47722c66eac08850d23a7026d6cc6bf4f6d929e 100644 --- a/test/integration/backpack.test.js +++ b/test/integration/backpack.test.js @@ -24,7 +24,6 @@ describe('Working with the how-to library', () => { test('Backpack is "Coming Soon" without backpack host param', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); // Check that the backpack header is visible and wrapped in a coming soon tooltip await clickText('Backpack', '*[@data-for="backpack-tooltip"]'); const logs = await getLogs(); @@ -33,7 +32,6 @@ describe('Working with the how-to library', () => { test('Backpack can be expanded with backpack host param', async () => { await loadUri(`${uri}?backpack_host=some-value`); - await clickXpath('//button[@title="Try It"]'); // Try activating the backpack from the costumes tab to make sure it isn't pushed off await clickText('Costumes'); diff --git a/test/integration/blocks.test.js b/test/integration/blocks.test.js index 950d285875d2514ffcbd80402227a872d940bc56..ed2b89eb43c14fe38c33c59b8848e5140f38eea5 100644 --- a/test/integration/blocks.test.js +++ b/test/integration/blocks.test.js @@ -29,7 +29,6 @@ describe('Working with the blocks', () => { test('Blocks report when clicked in the toolbox', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Code'); await clickText('Operators', scope.blocksTab); await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation @@ -41,7 +40,6 @@ describe('Working with the blocks', () => { test('Switching sprites updates the block menus', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Sound', scope.blocksTab); await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation // "Meow" sound block should be visible @@ -58,7 +56,6 @@ describe('Working with the blocks', () => { test('Creating variables', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Code'); await clickText('Variables', scope.blocksTab); await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation @@ -92,7 +89,6 @@ describe('Working with the blocks', () => { test('Creating a list', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Code'); await clickText('Variables', scope.blocksTab); await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation @@ -127,7 +123,6 @@ describe('Working with the blocks', () => { test('Custom procedures', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('My Blocks'); await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation await clickText('Make a Block'); @@ -146,7 +141,6 @@ describe('Working with the blocks', () => { test('Adding an extension', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickXpath('//button[@title="Add Extension"]'); await clickText('Pen'); @@ -160,7 +154,6 @@ describe('Working with the blocks', () => { test.only('Record option from sound block menu opens sound recorder', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Code'); await clickText('Sound', scope.blocksTab); await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation diff --git a/test/integration/connection-modal.test.js b/test/integration/connection-modal.test.js index 117be5ce5ed7031092fb40b8a120b68074d9cfcc..68ff893f59ab54d0d141222366e1071790330678 100644 --- a/test/integration/connection-modal.test.js +++ b/test/integration/connection-modal.test.js @@ -34,7 +34,6 @@ describe('Hardware extension connection modal', () => { test('Message saying Scratch Link is unavailable (BLE)', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await driver.executeScript(websocketFakeoutJs); @@ -50,7 +49,6 @@ describe('Hardware extension connection modal', () => { test('Message saying Scratch Link is unavailable (BT)', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await driver.executeScript(websocketFakeoutJs); diff --git a/test/integration/costumes.test.js b/test/integration/costumes.test.js index d46e1a4b07d43c15d4efcdfe555c5c868dd1d9af..62e9b4ef17bc9665b271d6b56d14eff3aaf4171d 100644 --- a/test/integration/costumes.test.js +++ b/test/integration/costumes.test.js @@ -27,7 +27,6 @@ describe('Working with costumes', () => { test('Adding a costume through the library', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); await clickXpath('//button[@aria-label="Choose a Costume"]'); const el = await findByXpath("//input[@placeholder='Search']"); @@ -40,7 +39,6 @@ describe('Working with costumes', () => { test('Adding a costume by surprise button', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); const el = await findByXpath('//button[@aria-label="Choose a Costume"]'); await driver.actions().mouseMove(el) @@ -53,7 +51,6 @@ describe('Working with costumes', () => { test('Adding a costume by paint button', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); const el = await findByXpath('//button[@aria-label="Choose a Costume"]'); await driver.actions().mouseMove(el) @@ -66,7 +63,6 @@ describe('Working with costumes', () => { test('Duplicating a costume', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); await rightClickText('costume1', scope.costumesTab); @@ -82,7 +78,6 @@ describe('Working with costumes', () => { test('Converting bitmap/vector in paint editor', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); // Convert the first costume to bitmap. @@ -106,7 +101,6 @@ describe('Working with costumes', () => { test('Undo/redo in the paint editor', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); await clickText('costume1', scope.costumesTab); await clickText('Convert to Bitmap', scope.costumesTab); @@ -121,7 +115,6 @@ describe('Working with costumes', () => { test('Adding an svg from file', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); const el = await findByXpath('//button[@aria-label="Choose a Costume"]'); await driver.actions().mouseMove(el) @@ -137,7 +130,6 @@ describe('Working with costumes', () => { test('Adding a png from file (gh-3582)', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); const el = await findByXpath('//button[@aria-label="Choose a Costume"]'); await driver.actions().mouseMove(el) @@ -155,7 +147,6 @@ describe('Working with costumes', () => { await driver.manage() .window() .setSize(1244, 768); // Letters filter not visible at 1024 width - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); await clickXpath('//button[@aria-label="Choose a Costume"]'); await clickText('Letters'); diff --git a/test/integration/how-tos.test.js b/test/integration/how-tos.test.js index dcdccb4994706fec851695f136e4e51c3f0567eb..577031f37d6d57bce4ba30f058041a2f591c594d 100644 --- a/test/integration/how-tos.test.js +++ b/test/integration/how-tos.test.js @@ -25,7 +25,6 @@ describe('Working with the how-to library', () => { test('Choosing a how-to', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); await clickXpath('//*[@aria-label="Tutorials"]'); await clickText('Getting Started'); // Modal should close diff --git a/test/integration/localization.test.js b/test/integration/localization.test.js index 4fb1e8d59f085b93a8fe9d457e720dc5ff7f96e4..e96dd059eca4544e0a0e7924338fd2bb0f2aaf97 100644 --- a/test/integration/localization.test.js +++ b/test/integration/localization.test.js @@ -26,7 +26,6 @@ describe('Localization', () => { test('Localization', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); // Add a sprite to make sure it stays when switching languages await clickText('Costumes'); diff --git a/test/integration/menu-bar.test.js b/test/integration/menu-bar.test.js index 6529b7bc4550a1114f9022e76c062ffbaff4f5d2..b5f0d7eae2893d87e1afeeedd173d41a50fa00b2 100644 --- a/test/integration/menu-bar.test.js +++ b/test/integration/menu-bar.test.js @@ -24,7 +24,6 @@ describe('Menu bar settings', () => { test('File->New should be enabled', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickXpath( '//div[contains(@class, "menu-bar_menu-bar-item") and ' + 'contains(@class, "menu-bar_hoverable")][span[text()="File"]]' @@ -34,7 +33,6 @@ describe('Menu bar settings', () => { test('File->Load should be enabled', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickXpath( '//div[contains(@class, "menu-bar_menu-bar-item") and ' + 'contains(@class, "menu-bar_hoverable")][span[text()="File"]]' @@ -44,7 +42,6 @@ describe('Menu bar settings', () => { test('File->Save should be enabled', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickXpath( '//div[contains(@class, "menu-bar_menu-bar-item") and ' + 'contains(@class, "menu-bar_hoverable")][span[text()="File"]]' @@ -54,13 +51,11 @@ describe('Menu bar settings', () => { test('Share button should NOT be enabled', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await findByXpath('//div[span[div[span[text()="Share"]]] and @data-tip="tooltip"]'); }); test('Logo should be clickable', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickXpath('//img[@alt="Scratch"]'); const currentUrl = await driver.getCurrentUrl(); await expect(currentUrl).toEqual('https://scratch.mit.edu/'); @@ -68,7 +63,6 @@ describe('Menu bar settings', () => { test('(GH#4064) Project name should be editable', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); const el = await findByXpath('//input[@value="Scratch Project"]'); await el.sendKeys(' - Personalized'); await clickText('Costumes'); // just to blur the input diff --git a/test/integration/project-loading.test.js b/test/integration/project-loading.test.js index bd305c4aad3e559d1fc78d477b83e97af6935058..0bf85fb4a505087900513ed7aac0d86e784807e7 100644 --- a/test/integration/project-loading.test.js +++ b/test/integration/project-loading.test.js @@ -26,44 +26,11 @@ describe('Loading scratch gui', () => { describe('Loading projects by ID', () => { - test('Load 2.0 project using import modal', async () => { - await loadUri(uri); - await clickText('View 2.0 Project'); - const el = await findByXpath("//input[@placeholder='scratch.mit.edu/projects/123456789']"); - const projectId = '96708228'; - await el.sendKeys(`scratch.mit.edu/projects/${projectId}`); - await clickXpath('//button[@title="View Project"]'); - await new Promise(resolve => setTimeout(resolve, 2000)); - await clickXpath('//img[@title="Go"]'); - await new Promise(resolve => setTimeout(resolve, 2000)); - await clickXpath('//img[@title="Stop"]'); - const logs = await getLogs(); - await expect(logs).toEqual([]); - }); - test('Nonexistent projects show error screen', async () => { await loadUri(`${uri}#999999999999999999999`); await clickText('Oops! Something went wrong.'); }); - test('Invalid url when loading project through modal lets you try again', async () => { - await loadUri(uri); - await clickText('View 2.0 Project'); - let el = await findByXpath("//input[@placeholder='scratch.mit.edu/projects/123456789']"); - await el.sendKeys('thisisnotaurl'); - await clickXpath('//button[@title="View Project"]'); - el = await findByXpath("//input[@placeholder='scratch.mit.edu/projects/123456789']"); - await el.clear(); - await el.sendKeys('scratch.mit.edu/projects/96708228'); - await clickXpath('//button[@title="View Project"]'); - await new Promise(resolve => setTimeout(resolve, 2000)); - await clickXpath('//img[@title="Go"]'); - await new Promise(resolve => setTimeout(resolve, 2000)); - await clickXpath('//img[@title="Stop"]'); - const logs = await getLogs(); - await expect(logs).toEqual([]); - }); - test('Load a project by ID directly through url', async () => { await driver.quit(); // Reset driver to test hitting # url directly driver = getDriver(); @@ -107,11 +74,6 @@ describe('Loading scratch gui', () => { test('Creating new project resets active tab to Code tab', async () => { await loadUri(uri); - await clickText('View 2.0 Project'); - const inputElement = await findByXpath("//input[@placeholder='scratch.mit.edu/projects/123456789']"); - const projectId = '96708228'; - await inputElement.sendKeys(`scratch.mit.edu/projects/${projectId}`); - await clickXpath('//button[@title="View Project"]'); await new Promise(resolve => setTimeout(resolve, 2000)); await findByXpath('//*[span[text()="Costumes"]]'); await clickText('Costumes'); @@ -126,11 +88,6 @@ describe('Loading scratch gui', () => { test('Not logged in->made no changes to project->create new project should not show alert', async () => { await loadUri(uri); - await clickText('View 2.0 Project'); - const inputElement = await findByXpath("//input[@placeholder='scratch.mit.edu/projects/123456789']"); - const projectId = '96708228'; - await inputElement.sendKeys(`scratch.mit.edu/projects/${projectId}`); - await clickXpath('//button[@title="View Project"]'); await new Promise(resolve => setTimeout(resolve, 2000)); await clickXpath( '//div[contains(@class, "menu-bar_menu-bar-item") and ' + @@ -143,11 +100,6 @@ describe('Loading scratch gui', () => { test('Not logged in->made a change to project->create new project should show alert', async () => { await loadUri(uri); - await clickText('View 2.0 Project'); - const inputElement = await findByXpath("//input[@placeholder='scratch.mit.edu/projects/123456789']"); - const projectId = '96708228'; - await inputElement.sendKeys(`scratch.mit.edu/projects/${projectId}`); - await clickXpath('//button[@title="View Project"]'); await new Promise(resolve => setTimeout(resolve, 2000)); await clickText('move'); await clickXpath( diff --git a/test/integration/sounds.test.js b/test/integration/sounds.test.js index 3877ada3f8fa90acb8e866418fcc5ff1425b516d..09bfdc5f1d8300a8be2554b69b8818a94f60fa5b 100644 --- a/test/integration/sounds.test.js +++ b/test/integration/sounds.test.js @@ -27,7 +27,6 @@ describe('Working with sounds', () => { test('Adding a sound through the library', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Sounds'); // Delete the sound @@ -64,7 +63,6 @@ describe('Working with sounds', () => { test('Adding a sound by surprise button', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Sounds'); const el = await findByXpath('//button[@aria-label="Choose a Sound"]'); await driver.actions().mouseMove(el) @@ -77,7 +75,6 @@ describe('Working with sounds', () => { test('Duplicating a sound', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Sounds'); await rightClickText('Meow', scope.soundsTab); @@ -94,7 +91,6 @@ describe('Working with sounds', () => { // Regression test for gui issue #1320 test('Switching sprites with different numbers of sounds', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); // Add a sound so this sprite has 2 sounds. await clickText('Sounds'); diff --git a/test/integration/sprites.test.js b/test/integration/sprites.test.js index a3dd48cf4a5e319fd8660276ed22330910eeca53..76cfae1213c3ce62e27891ff73847166a1ea7709 100644 --- a/test/integration/sprites.test.js +++ b/test/integration/sprites.test.js @@ -29,7 +29,6 @@ describe('Working with sprites', () => { test('Adding a sprite through the library', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); await clickXpath('//button[@aria-label="Choose a Sprite"]'); await clickText('Apple', scope.modal); // Closes modal @@ -41,7 +40,6 @@ describe('Working with sprites', () => { test('Adding a sprite by surprise button', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); const el = await findByXpath('//button[@aria-label="Choose a Sprite"]'); await driver.actions().mouseMove(el) .perform(); @@ -53,7 +51,6 @@ describe('Working with sprites', () => { test('Adding a sprite by paint button', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); const el = await findByXpath('//button[@aria-label="Choose a Sprite"]'); await driver.actions().mouseMove(el) .perform(); @@ -66,7 +63,6 @@ describe('Working with sprites', () => { test('Deleting only sprite does not crash', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation await rightClickText('Sprite1', scope.spriteTile); await clickText('delete', scope.spriteTile); @@ -78,7 +74,6 @@ describe('Working with sprites', () => { test('Deleting by x button on sprite tile', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation await clickXpath('//*[@aria-label="Close"]'); // Only visible close button is on the sprite // Confirm that the stage has been switched to @@ -89,7 +84,6 @@ describe('Working with sprites', () => { test('Adding a sprite by uploading a png', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); const el = await findByXpath('//button[@aria-label="Choose a Sprite"]'); await driver.actions().mouseMove(el) .perform(); @@ -105,7 +99,6 @@ describe('Working with sprites', () => { // Enable when this is fixed issues/3608 test('Adding a sprite by uploading an svg (gh-3608)', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); const el = await findByXpath('//button[@aria-label="Choose a Sprite"]'); await driver.actions().mouseMove(el) .perform(); @@ -127,7 +120,6 @@ describe('Working with sprites', () => { await driver.manage() .window() .setSize(1244, 768); // Letters filter not visible at 1024 width - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); await clickXpath('//button[@aria-label="Choose a Sprite"]'); await clickText('Letters'); @@ -140,7 +132,6 @@ describe('Working with sprites', () => { test('Use browser back button to close library', async () => { await driver.get('https://www.google.com'); await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); await clickText('Costumes'); await clickXpath('//button[@aria-label="Choose a Sprite"]'); const abbyElement = await findByText('Abby'); // Should show editor for new costume diff --git a/test/integration/stage-size.test.js b/test/integration/stage-size.test.js index ada2e5b16faa5e6b7844054f2d5ea21021e5bbd4..72de9c5bb1516c29554850f9a3d50b0f0f10c3ae 100644 --- a/test/integration/stage-size.test.js +++ b/test/integration/stage-size.test.js @@ -26,7 +26,6 @@ describe('Loading scratch gui', () => { test('Switching small/large stage after highlighting and deleting sprite', async () => { await loadUri(uri); - await clickXpath('//button[@title="Try It"]'); // Highlight the sprite await clickText('Sprite1', scope.spriteTile);