Skip to content
Snippets Groups Projects
Commit 57081526 authored by Ben Wheeler's avatar Ben Wheeler
Browse files

added test for resetting to code tab after file new

parent f03c251f
Branches
Tags
No related merge requests found
......@@ -7,7 +7,8 @@ const {
findByXpath,
getDriver,
getLogs,
loadUri
loadUri,
scope
} = new SeleniumHelper();
const uri = path.resolve(__dirname, '../../build/index.html');
......@@ -105,5 +106,27 @@ describe('Loading scratch gui', () => {
const logs = await getLogs();
await expect(logs).toEqual([]);
});
test('Creating new project resets active tab to Code tab', 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 findByXpath('//*[span[text()="Costumes"]]');
await clickText('Costumes');
await clickXpath(
'//div[contains(@class, "menu-bar_menu-bar-item") and ' +
'contains(@class, "menu-bar_hoverable")][span[text()="File"]]'
);
await clickXpath('//li[span[text()="New"]]');
driver.switchTo()
.alert()
.accept();
await findByXpath('//*[div[@class="scratchCategoryMenu"]]');
await clickText('Operators', scope.blocksTab);
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment