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

Navigation #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ The envirom variables file `cypress.env.json` has not been commited. You can cre
{
"un_qa_org": "", # username for a user with django admin access
"pw_qa_org": "", # password for a user with django admin access
"fn_qa_org": "", # First Name for a user with django admin access
"ln_qa_org": "", # Last Name or a user with django admin access
"api_key_mailslurp": "", # [Mailslurp](https://www.mailslurp.com/) api key
"mailslurp_inbox": "" # Mailslurp inbox id
}
Expand Down
Binary file modified cypress/integration/.DS_Store
Binary file not shown.
196 changes: 196 additions & 0 deletions cypress/integration/sanity/ATCATC-5_Navigation.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
/// <reference types="Cypress" />

context("Navigating using dropdown menu", () => {
let env;
before(() => {
env = Cypress.env();
});

beforeEach(() => {
cy.apiLogin(env.un_qa_org, env.pw_qa_org);
cy.visit("/");
});

const menuNavigation = (menu, submenu, title, clases = "") => {
cy.get(`${clases}.dropdown-toggle`)
.contains(menu)
.click();
cy.get(".dropdown-menu > li")
.contains(submenu)
.click();

if (clases === "") {
cy.get(".dropdown-toggle")
.contains(menu)
.parent()
.should("have.class", "active");
}

cy.get(".page-title").should("contain", title);
};

it("ACTATC-5.1 Navigates using the Workflows menu", () => {
// Landing Page
cy.get(".page-title").should("contain", "My Dashboard");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='modal']")
.contains("Programs")
.should("exist");
// Programs Page
menuNavigation("Workflows", "Programs", "Programs List");
cy.get("#show-modal").should("contain", "Programs");

// Projects Page
menuNavigation("Workflows", "Projects", "Projects List");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Projects Status")
.should("exist");
cy.get("button[data-toggle='modal']")
.contains("Projects")
.should("exist");
});

it("ACTATC-5.2 Navigates using the Indicator menu", () => {
// Indicators Page
menuNavigation("Indicators", "Indicators", "Indicators List");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='modal']")
.contains("Indicators")
.should("exist");

// Objectives Page
menuNavigation("Indicators", "Objectives", "Objective List");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("#show-modal").should("contain", "Objective");
});

it("ACTATC-5.3 Navigates using the Form Library menu", () => {
// Individuals Page
menuNavigation("Form Library", "Individuals", "Individuals List");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Training")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Distribution")
.should("exist");
cy.get("button[data-toggle='modal']")
.contains("Individual")
.should("exist");

// Distribution Page
menuNavigation("Form Library", "Distribution", "Distribution List");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Projects")
.should("exist");
cy.get("button[data-toggle='modal']")
.contains("Distribution")
.should("exist");

// Training Page
menuNavigation("Form Library", "Training", "Training List");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Projects")
.should("exist");
cy.get("button[data-toggle='modal']")
.contains("Training")
.should("exist");
});

it("ACTATC-5.4 Navigates using the Components menu", () => {
// Contacts Page
menuNavigation("Components", "Contacts", "Contact List");
cy.get("button[data-toggle='dropdown']")
.contains("Stakeholder")
.should("exist");
cy.get("button[data-toggle='modal']")
.contains("Contact")
.should("exist");

// Documents Page
menuNavigation("Components", "Documents", "Document List");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Projects")
.should("exist");
cy.get("#show-modal").should("contain", "Document");

// Locations Page
menuNavigation("Components", "Locations", "Locations List");
cy.get("button[data-toggle='dropdown']")
.contains("Site Status")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Projects")
.should("exist");
cy.get("button[data-toggle='modal']")
.contains("Locations")
.should("exist");

// Stakeholders Page
menuNavigation("Components", "Stakeholders", "Stakeholder List");
cy.get("button[data-toggle='dropdown']")
.contains("Programs")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Projects")
.should("exist");
cy.get("a[data-toggle='modal']")
.contains("Stakeholders")
.should("exist");
});

it("ACTATC-5.5 Navigates using the Reports menu", () => {
// Dashboards Page
menuNavigation("Reports", "Dashboards", "Dashboard List");
cy.get("button[data-toggle='dropdown']")
.contains("Filter by Sector")
.should("exist");
cy.get("button[data-toggle='dropdown']")
.contains("Filter by Countries")
.should("exist");
});

it("ACTATC-5.6 Navigates using the User Avatar menu", () => {
// Profile Page
menuNavigation(
env.fn_qa_org[0],
"Profile",
"My Profile",
".navbar-right > .dropdown > "
);
cy.get(".btn")
.contains("Change Password")
.should("exist");

// Organization Settings Page
menuNavigation(
env.fn_qa_org[0],
"Organization Settings",
"Organization Settings",
".navbar-right > .dropdown > "
);
});
});