Commit f1b675b1 by Hugo Häggmark Committed by GitHub

e2e: Waits for login before moving forward (#21185)

parent 06761892
......@@ -8,5 +8,11 @@ export const login = (username: string, password: string) => {
.type(username);
e2e.pages.Login.password().type(password);
e2e.pages.Login.submit().click();
e2e.pages.Login.skip()
.should('be.visible')
.click();
e2e()
.get('.login-page')
.should('not.exist');
e2e().logToConsole('Logged in with', { username, password });
};
......@@ -6,5 +6,6 @@ export const Login = pageFactory({
username: 'Username input field',
password: 'Password input field',
submit: 'Login button',
skip: 'Skip change password button',
},
});
import React, { PureComponent, SyntheticEvent, ChangeEvent } from 'react';
import React, { ChangeEvent, PureComponent, SyntheticEvent } from 'react';
import { Tooltip } from '@grafana/ui';
import appEvents from 'app/core/app_events';
import { AppEvents } from '@grafana/data';
import { e2e } from '@grafana/e2e';
import appEvents from 'app/core/app_events';
interface Props {
onSubmit: (pw: string) => void;
......@@ -115,7 +117,7 @@ export class ChangePassword extends PureComponent<Props, State> {
placement="bottom"
content="If you skip you will be prompted to change password next time you login."
>
<a className="btn btn-link" onClick={this.onSkip}>
<a className="btn btn-link" onClick={this.onSkip} aria-label={e2e.pages.Login.selectors.skip}>
Skip
</a>
</Tooltip>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment