File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/compass-e2e-tests/tests Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -165,13 +165,25 @@ describe('Atlas Login', function () {
165165
166166 const acceptTOSToggle = browser . $ ( Selectors . AcceptTOSToggle ) ;
167167
168- expect ( await acceptTOSToggle . getAttribute ( 'aria-checked' ) ) . to . eq ( 'false' ) ;
168+ expect ( await acceptTOSToggle . getAttribute ( 'aria-checked' ) ) . to . eq (
169+ 'false' ,
170+ 'Expected TOS toggle to be unchecked'
171+ ) ;
169172
170173 await browser . clickVisible ( acceptTOSToggle ) ;
171174
172175 await browser . clickVisible ( Selectors . AgreeAndContinueButton ) ;
173176
174- expect ( await acceptTOSToggle . getAttribute ( 'aria-checked' ) ) . to . eq ( 'true' ) ;
177+ // We are not just waiting here, this is asserting that toggle was
178+ // switched on, indicating that TOS was accepted
179+ await browser . waitUntil (
180+ async ( ) => {
181+ return (
182+ ( await acceptTOSToggle . getAttribute ( 'aria-checked' ) ) === 'true'
183+ ) ;
184+ } ,
185+ { timeoutMsg : 'Expected TOS toggle to be checked' }
186+ ) ;
175187 } ) ;
176188
177189 it ( 'should sign out user when "Disconnect" clicked' , async function ( ) {
You can’t perform that action at this time.
0 commit comments