Skip to content

Commit 4495cfc

Browse files
committed
test: fix
1 parent 612b65d commit 4495cfc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/integration/project-loading.test.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const {
99
getDriver,
1010
getLogs,
1111
loadUri,
12+
notExistsByXpath,
1213
scope
1314
} = new SeleniumHelper();
1415

@@ -79,28 +80,31 @@ describe('Loading scratch gui', () => {
7980
await expect(logs).toEqual([]);
8081
});
8182

82-
// skipping because this test fails frequently on CI; might need "wait(until.elementLocated" or similar
83-
// error message is "stale element reference: element is not attached to the page document"
84-
test.skip('Creating new project resets active tab to Code tab', async () => {
83+
test('Creating new project resets active tab to Code tab', async () => {
8584
await loadUri(uri);
85+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
8686
await findByXpath('//*[span[text()="Costumes"]]');
8787
await clickText('Costumes');
8888
await clickXpath(FILE_MENU_XPATH);
8989
await clickXpath('//li[span[text()="New"]]');
90+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
9091
await findByXpath('//div[@class="scratchCategoryMenu"]');
9192
await clickText('Operators', scope.blocksTab);
9293
});
9394

9495
test('Not logged in->made no changes to project->create new project should not show alert', async () => {
9596
await loadUri(uri);
97+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
9698
await clickXpath(FILE_MENU_XPATH);
9799
await clickXpath('//li[span[text()="New"]]');
100+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
98101
await findByXpath('//*[div[@class="scratchCategoryMenu"]]');
99102
await clickText('Operators', scope.blocksTab);
100103
});
101104

102-
test.skip('Not logged in->made a change to project->create new project should show alert', async () => {
105+
test('Not logged in->made a change to project->create new project should show alert', async () => {
103106
await loadUri(uri);
107+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
104108
await clickText('Sounds');
105109
await clickXpath('//button[@aria-label="Choose a Sound"]');
106110
await clickText('A Bass', scope.modal); // Should close the modal
@@ -110,6 +114,7 @@ describe('Loading scratch gui', () => {
110114
driver.switchTo()
111115
.alert()
112116
.accept();
117+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
113118
await findByXpath('//*[div[@class="scratchCategoryMenu"]]');
114119
await clickText('Operators', scope.blocksTab);
115120
});

0 commit comments

Comments
 (0)