Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/support/gutenberg-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Cypress.Commands.add( 'newPost', () => {

Cypress.Commands.add( 'visitAdmin', ( adminPath ) => {
cy.visit( '/wp-admin/' + adminPath ).location( 'pathname' ).then( ( path ) => {
if ( path === '/wp-login.php' ) {
if ( path.endsWith( '/wp-login.php' ) ) {
Copy link
Copy Markdown
Member

@ellatrix ellatrix Feb 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we polyfill these ATM with Babel. I've been made aware of this several times by @aduth . :) Maybe use the Lodash version here instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though, this probably runs in the Cypress runner which doesn't have the same constraints as the browser (or all browsers)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's node 8 + electron or Chrome. Travis is happy so are we :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, stupid me, I just saw the lines and my alarm bells went off without realising this is Cypress. :D

cy.login();
}
} );
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/support/user-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Cypress.Commands.add( 'login', ( username = Cypress.env( 'username' ), password
// (not sure this is possible in WP)

cy.location( 'pathname' ).then( ( path ) => {
if ( path !== '/wp-login.php' ) {
if ( ! path.endsWith( '/wp-login.php' ) ) {
cy.visit( '/wp-login.php' );
}
} );
Expand Down