Skip to content
Snippets Groups Projects
Commit 130bd3f0 authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Add integration test for changing languages not clearing project

parent b18b428a
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,9 @@ const { ...@@ -6,7 +6,9 @@ const {
clickXpath, clickXpath,
getDriver, getDriver,
getLogs, getLogs,
loadUri loadUri,
scope,
rightClickText
} = new SeleniumHelper(); } = new SeleniumHelper();
const uri = path.resolve(__dirname, '../../build/index.html'); const uri = path.resolve(__dirname, '../../build/index.html');
...@@ -25,6 +27,13 @@ describe('Localization', () => { ...@@ -25,6 +27,13 @@ describe('Localization', () => {
test('Localization', async () => { test('Localization', async () => {
await loadUri(uri); await loadUri(uri);
await clickXpath('//button[@title="Try It"]'); await clickXpath('//button[@title="Try It"]');
// Add a sprite to make sure it stays when switching languages
await clickText('Costumes');
await clickXpath('//button[@aria-label="Choose a Sprite"]');
await clickText('Apple', scope.modal); // Closes modal
await clickText('Code');
await clickXpath('//*[@aria-label="language selector"]'); await clickXpath('//*[@aria-label="language selector"]');
await clickText('Deutsch'); await clickText('Deutsch');
await new Promise(resolve => setTimeout(resolve, 1000)); // wait for blocks refresh await new Promise(resolve => setTimeout(resolve, 1000)); // wait for blocks refresh
...@@ -37,6 +46,9 @@ describe('Localization', () => { ...@@ -37,6 +46,9 @@ describe('Localization', () => {
// Change to the costumes tab to confirm other parts of the GUI are translating // Change to the costumes tab to confirm other parts of the GUI are translating
await clickText('Kostüme'); await clickText('Kostüme');
// After switching languages, make sure Apple sprite still exists
await rightClickText('Apple', scope.spriteTile); // Make sure it is there
const logs = await getLogs(); const logs = await getLogs();
await expect(logs).toEqual([]); await expect(logs).toEqual([]);
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment