Refactor to use "data-e2e" attributes in code to make selecting fields/buttons easier in e2e tests

This commit is contained in:
Tim Donohue
2022-01-07 15:11:12 -06:00
parent cb91ccbc33
commit 794aa33c8f
12 changed files with 94 additions and 54 deletions

View File

@@ -9,7 +9,8 @@
formControlName="email"
placeholder="{{'login.form.email' | translate}}"
required
type="email">
type="email"
data-e2e="email">
<label class="sr-only">{{"login.form.password" | translate}}</label>
<input [attr.aria-label]="'login.form.password' |translate"
autocomplete="off"
@@ -17,12 +18,13 @@
placeholder="{{'login.form.password' | translate}}"
formControlName="password"
required
type="password">
type="password"
data-e2e="password">
<div *ngIf="(error | async) && hasError" class="alert alert-danger" role="alert"
@fadeOut>{{ (error | async) | translate }}</div>
<div *ngIf="(message | async) && hasMessage" class="alert alert-info" role="alert"
@fadeOut>{{ (message | async) | translate }}</div>
<button class="btn btn-lg btn-primary btn-block mt-3" type="submit"
<button class="btn btn-lg btn-primary btn-block mt-3" type="submit" data-e2e="login-button"
[disabled]="!form.valid"><i class="fas fa-sign-in-alt"></i> {{"login.form.submit" | translate}}</button>
</form>