Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FHB-1113: E2E Automated Tests: Adding Users in Manage as Dfe Admin #355

Closed
wants to merge 15 commits into from
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
</div>

<button type="submit" class="govuk-button" data-module="govuk-button">
<button type="submit" data-testid='buttonContinue' class="govuk-button" data-module="govuk-button">
Continue
</button>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@

<input class="govuk-input @(error?.InputClass)" maxlength="@(Model.MaxLength)"
name="TextBoxValue" type="@type" value="@Model.TextBoxValue" inputmode="@type"
spellcheck="false" autocomplete="off" id="@textBoxId"
spellcheck="false" autocomplete="off" id="@textBoxId" data-testid="@textBoxId"
aria-describedby="@(string.IsNullOrEmpty(Model.HintText) ? "" : "hint ")@error?.InputErrorMessageParaId">
</div>
<button type="submit" class="govuk-button" data-module="govuk-button">
<button type="submit" data-testid="buttonContinue" class="govuk-button" data-module="govuk-button">
Continue
</button>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

</fieldset>
</div>
<button class="govuk-button" id="buttonContinue">
<button class="govuk-button" data-testid="buttonContinue" id="buttonContinue">
@Model.SubmitButtonText
</button>
</form>
Expand Down
2 changes: 1 addition & 1 deletion test/manage-e2e-tests/tests/manage-login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
clickOnTheStartButton,
isTheManageHomepageDisplayed,
loginToManage,
navigateToManage,
navigateToManage
} from './serenity-tools/manage-index';

describe('Manage Tests', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const addServicesUserActivity = () =>

export const laOrganisationInputBox = () =>
PageElement
.located(By.css("[id='LaOrganisationName']"))
.located(By.css("[data-testid='LaOrganisationName']"))
.describedAs('LA Organisation Input Box');

export const laOrganisationInputSuggestion = () =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Answerable, Check, Task} from '@serenity-js/core';
import {Click, Enter, isVisible} from '@serenity-js/web';
import {Click, Enter, isVisible, Scroll} from '@serenity-js/web';
import {
addServicesUserActivity,
addUserLink,
Expand Down Expand Up @@ -42,17 +42,20 @@ export const selectUserAction = (actionType: Answerable<string>): Task =>

export const selectLocalAuthority = (laName: Answerable<string>): Task =>
Task.where(`#actor assigns ${laName} local authority to user`,
Scroll.to(laOrganisationInputBox()),
Enter.theValue(laName).into(laOrganisationInputBox()),
Click.on(laOrganisationInputSuggestion())
);

export const enterTestEmail = (emailAddress: Answerable<string>): Task =>
Task.where(`#actor assigns ${emailAddress} email address to user`,
Scroll.to(emailAddressInputBox()),
Enter.theValue(emailAddress).into(emailAddressInputBox())
);

export const enterFullName = (fullName: Answerable<string>): Task =>
Task.where(`#actor assigns ${fullName} full name address to user`,
Scroll.to(fullNameInputBox()),
Enter.theValue(fullName).into(fullNameInputBox())
);

Expand All @@ -78,6 +81,7 @@ export const searchForUserByName = (fullName: Answerable<string>): Task =>
.andIfSo(
Click.on(showFiltersButton())
),
Scroll.to(userNameFilterInputBox()),
Enter.theValue(fullName).into(userNameFilterInputBox()),
Click.on(applyFilterButton())
);
Loading