Skip to content

Commit

Permalink
[cypress][SIMS bcgov#1541] Adding Institution data-cy ids - 2 (bcgov#…
Browse files Browse the repository at this point in the history
…1589)

- Adding more data-cy ids
- Adjusting the hierarchy to match the test cases for the TestQuality
  • Loading branch information
velang01 authored Dec 6, 2022
1 parent 6e5f8d2 commit 5ea9bb1
Show file tree
Hide file tree
Showing 18 changed files with 610 additions and 390 deletions.
23 changes: 18 additions & 5 deletions sources/packages/web/src/components/common/LocationSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
class="m-1"
:recordsCount="institutionLocationList.length"
><template #actions>
<!-- Todo: We to eventually eliminate the logic which is based
<!-- Todo: We to eventually eliminate the logic which is based
on the client type on the vue components.-->
<v-btn
v-if="clientType === ClientIdType.Institution"
class="float-right"
color="primary"
@click="goToAddNewLocation()"
prepend-icon="fa:fa fa-plus-circle"
data-cy="addLocation"
>
Add location
</v-btn>
Expand All @@ -22,13 +23,19 @@
v-for="item in institutionLocationList"
:key="item"
class="ma-2"
data-cy="institutionLocation"
>
<v-row>
<v-col md="10">
<div>
<v-icon icon="mdi-map-marker-outline"></v-icon>
<span class="category-header-medium mx-1">{{ item.name }}</span>
<status-chip-designation-agreement :status="item.designationStatus" />
<span data-cy="locationName" class="category-header-medium mx-1">{{
item.name
}}</span>
<status-chip-designation-agreement
data-cy="institutionDesignationStatus"
:status="item.designationStatus"
/>
</div>
</v-col>
<v-col>
Expand All @@ -41,6 +48,7 @@
:disabled="notAllowed"
@click="$emit('editLocation', item.id)"
prepend-icon="fa:fa fa-gear"
data-cy="editLocation"
>
Edit
</v-btn>
Expand All @@ -56,6 +64,7 @@
class="label-value muted-content clearfix"
v-for="addressLine in addressList1(item)"
:key="addressLine"
data-cy="institutionAddress1"
>
{{ addressLine }}
</span>
Expand All @@ -64,7 +73,7 @@
<!-- Address 2 -->
<v-col>
<title-value propertyTitle="Address line 2" />
<span>---</span>
<span data-cy="institutionAddress2">---</span>
</v-col>

<!-- Primary contact -->
Expand All @@ -74,14 +83,18 @@
class="label-value muted-content clearfix"
v-for="contactLine in primaryContactList(item)"
:key="contactLine"
data-cy="institutionPrimaryContact"
>
{{ contactLine }}
</span>
</v-col>
<!-- Institution code -->
<v-col>
<title-value propertyTitle="Institution code" />
<span class="label-value muted-content clearfix">
<span
data-cy="institutionCode"
class="label-value muted-content clearfix"
>
{{ item.institutionCode }}
</span>
</v-col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class="sidebar-item no-wrap"
active-class="active-list-item"
:items="items"
data-cy="sideBarMenu"
>
</v-list
><template #append>
Expand All @@ -17,6 +18,7 @@
active-class="active-list-item"
bg-color="default"
active-color="primary"
data-cy="offeringsUpload"
>
<v-list-item
:to="{ name: InstitutionRoutesConst.OFFERINGS_UPLOAD }"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,34 @@
:rows="DEFAULT_PAGE_LIMIT"
:rowsPerPageOptions="PAGINATION_LIST"
:totalRecords="designations.length"
data-cy="designationsList"
>
<Column header="Date submitted"
><template #body="slotProps">
<span>{{ dateOnlyLongString(slotProps.data.submittedDate) }}</span>
<span data-cy="designationSubmittedDate">{{
dateOnlyLongString(slotProps.data.submittedDate)
}}</span>
</template>
</Column>
<Column header="Start date"
><template #body="slotProps">
<span>{{ dateOnlyLongString(slotProps.data.startDate) }}</span>
<span data-cy="designationStartDate">{{
dateOnlyLongString(slotProps.data.startDate)
}}</span>
</template>
</Column>
<Column header="Expiry date"
><template #body="slotProps">
<span>{{ dateOnlyLongString(slotProps.data.endDate) }}</span>
<span data-cy="designationEndDate">{{
dateOnlyLongString(slotProps.data.endDate)
}}</span>
</template>
</Column>
<Column header="Status"
><template #body="slotProps">
<status-chip-designation
:status="slotProps.data.designationStatus"
data-cy="designationStatus"
/> </template
></Column>
<Column header="Action">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
title="Manage locations"
:routeLocation="goBackRouteParams"
subTitle="Edit Location"
data-cy="editLocationHeader"
/>
</template>
<location-edit-form
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>
<full-page-container>
<template #header>
<header-navigator title="Institution" subTitle="My Profile" />
<header-navigator
data-cy="institutionUserProfileHeader"
title="Institution"
subTitle="My Profile"
/>
</template>
<template #alerts>
<banner :type="BannerTypes.Info" header="Updating read-only information">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<header-navigator
title="Manage institution"
subTitle="Manage Designations"
data-cy="manageDesignationHeader"
/>
</template>
<body-header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const institutionHelperActions = new InstitutionHelperActions();
const [URL, USERNAME, PASSWORD] =
institutionHelperActions.getBaseUrlAndLoginCredentialsInstitution();

describe("[Institution Login] - Login Page", () => {
describe("Login Page", () => {
beforeEach(() => {
cy.visit(URL);
});
Expand All @@ -24,8 +24,9 @@ describe("[Institution Login] - Login Page", () => {
.should("have.text", "The user ID or password you entered is incorrect");
});

it("Verify login successfully", () => {
it("Verify successful login in to institution dashboard", () => {
institutionCustomCommand.loginWithCredentials(USERNAME, PASSWORD);
dashboardObject.institutionLandingPage().should("be.visible");
dashboardObject.dashboardWelcomeMessage().should("be.visible");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const dashboardObject = new DashboardInstitutionObject();
const manageInstitutionObject = new ManageInstitutionObject();
const institutionHelperActions = new InstitutionHelperActions();

describe("[Institution Dashboard] - fields and titles ", () => {
describe("Institution Dashboard", () => {
beforeEach(() => {
institutionHelperActions.loginIntoInstitutionSingleLocation();
});
Expand All @@ -28,7 +28,7 @@ describe("[Institution Dashboard] - fields and titles ", () => {
.should("have.attr", "href", "https://studentaidbc.ca/help-centre");
});

it("Verify that all buttons are clickable in dashboard and redirect to appropriate pages.", () => {
it("Verify that buttons displayed on the dashboard page are clickable", () => {
dashboardObject.homeButton().click();
dashboardObject.locationButton().click();
dashboardObject.manageInstitutionButton().click();
Expand All @@ -41,8 +41,13 @@ describe("[Institution Dashboard] - fields and titles ", () => {
dashboardObject.logOutButton().click();
});

it("Verify that clicking on manage institution leads Location Summary page", () => {
it("Verify that clicking on Manage Institution should navigate “Manage Institutions Page”", () => {
dashboardObject.manageInstitutionButton().click();
dashboardObject.allLocationsText().should("be.visible");
dashboardObject.manageInstitutionProfileHeader().should("be.visible");
});

it("Verify that clicking on Manage Profile should navigate “My Profile Page”", () => {
dashboardObject.myProfileButton().click();
dashboardObject.manageInstitutionProfileHeader().should("be.visible");
});
});
Loading

0 comments on commit 5ea9bb1

Please sign in to comment.