9
9
getDriver,
10
10
getLogs,
11
11
loadUri,
12
+ notExistsByXpath,
12
13
scope
13
14
} = new SeleniumHelper ( ) ;
14
15
@@ -79,28 +80,31 @@ describe('Loading scratch gui', () => {
79
80
await expect ( logs ) . toEqual ( [ ] ) ;
80
81
} ) ;
81
82
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 ( ) => {
85
84
await loadUri ( uri ) ;
85
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
86
86
await findByXpath ( '//*[span[text()="Costumes"]]' ) ;
87
87
await clickText ( 'Costumes' ) ;
88
88
await clickXpath ( FILE_MENU_XPATH ) ;
89
89
await clickXpath ( '//li[span[text()="New"]]' ) ;
90
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
90
91
await findByXpath ( '//div[@class="scratchCategoryMenu"]' ) ;
91
92
await clickText ( 'Operators' , scope . blocksTab ) ;
92
93
} ) ;
93
94
94
95
test ( 'Not logged in->made no changes to project->create new project should not show alert' , async ( ) => {
95
96
await loadUri ( uri ) ;
97
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
96
98
await clickXpath ( FILE_MENU_XPATH ) ;
97
99
await clickXpath ( '//li[span[text()="New"]]' ) ;
100
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
98
101
await findByXpath ( '//*[div[@class="scratchCategoryMenu"]]' ) ;
99
102
await clickText ( 'Operators' , scope . blocksTab ) ;
100
103
} ) ;
101
104
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 ( ) => {
103
106
await loadUri ( uri ) ;
107
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
104
108
await clickText ( 'Sounds' ) ;
105
109
await clickXpath ( '//button[@aria-label="Choose a Sound"]' ) ;
106
110
await clickText ( 'A Bass' , scope . modal ) ; // Should close the modal
@@ -110,6 +114,7 @@ describe('Loading scratch gui', () => {
110
114
driver . switchTo ( )
111
115
. alert ( )
112
116
. accept ( ) ;
117
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
113
118
await findByXpath ( '//*[div[@class="scratchCategoryMenu"]]' ) ;
114
119
await clickText ( 'Operators' , scope . blocksTab ) ;
115
120
} ) ;
0 commit comments