Skip to content

Commit

Permalink
E2E: Log out by actually clicking Log Out link
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsf committed Sep 25, 2019
1 parent a742a1a commit eb2eba8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/e2e-tests/specs/autosave.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,15 @@ describe( 'autosave', () => {
), await getCurrentPostId() );
expect( await page.evaluate( () => window.sessionStorage.length ) ).toBe( 1 );

const logoutUrl = await page.$eval( '#wp-admin-bar-logout a', ( element ) => element.href );
await page.goto( logoutUrl );
await Promise.all( [
page.waitForSelector( '#wp-admin-bar-logout', { visible: true } ),
page.hover( '#wp-admin-bar-my-account' ),
] );
await Promise.all( [
page.waitForNavigation(),
page.click( '#wp-admin-bar-logout' ),
] );

expect( await page.evaluate( () => window.sessionStorage.length ) ).toBe( 0 );
} );

Expand Down

0 comments on commit eb2eba8

Please sign in to comment.