@grafana/e2e: only skip password reset on local tests (#24411)

This commit is contained in:
Steven Vachon 2020-05-07 20:06:10 -04:00 committed by GitHub
parent f37c64c80c
commit 648dda96e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,9 +8,18 @@ export const login = (username: string = 'admin', password: string = 'admin') =>
.type(username);
e2e.pages.Login.password().type(password);
e2e.pages.Login.submit().click();
e2e.pages.Login.skip()
.should('be.visible')
.click();
// Local tests will have insecure credentials
e2e()
.url()
.then(url => {
if (/^https?:\/\/localhost/.test(url)) {
e2e.pages.Login.skip()
.should('be.visible')
.click();
}
});
e2e()
.get('.login-page')
.should('not.exist');