Merge pull request #3574 from paulkaplan/localization-integration-test
Add integration test for changing languages not clearing project
This commit is contained in:
1 file changed
+13
-1
@@ -6,7 +6,9 @@ const {
|
||||
clickXpath,
|
||||
getDriver,
|
||||
getLogs,
|
||||
loadUri
|
||||
loadUri,
|
||||
scope,
|
||||
rightClickText
|
||||
} = new SeleniumHelper();
|
||||
|
||||
const uri = path.resolve(__dirname, '../../build/index.html');
|
||||
@@ -25,6 +27,13 @@ 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');
|
||||
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 clickText('Deutsch');
|
||||
await new Promise(resolve => setTimeout(resolve, 1000)); // wait for blocks refresh
|
||||
@@ -37,6 +46,9 @@ describe('Localization', () => {
|
||||
// Change to the costumes tab to confirm other parts of the GUI are translating
|
||||
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();
|
||||
await expect(logs).toEqual([]);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user