Skip to content

Commit

Permalink
Merge pull request #1013 from necyberteam/cypress-hannah-11-15-2023
Browse files Browse the repository at this point in the history
Cypress hannah 11 15 2023
  • Loading branch information
a-pasquale authored Nov 29, 2023
2 parents 3378605 + a0b68da commit 45bc7a2
Show file tree
Hide file tree
Showing 21 changed files with 805 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function create_dummy_ci_link() {
cy.get('#edit-category').select('Learning');
cy.get('#edit-skill-level-304').check(); // beginner level
cy.get('#edit-description').type("Dummy description for ci-link 'access-support-ci-link-for-testing'");
// tag "access-acount" is selected
// tag "access-account" is selected
cy.get('span[data-tid="733"]').click();
cy.get('#edit-submit').click();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
This test is specifically focused on the Announcements form tested for an authenticated user.
This test checks for major functions like:
Page Title,
Header text,
Form Functionality
The announcement is not finished a body needs to be added and Pecan Pie needs to become a coordinator
//cy.get("#edit-field-affinity-group-node-0-target-id").type(
//"ACCESS Support (327)"
//);
*/

describe("Authenticated user tests the Announcement Form without adding an Affinity Group", () => {
it("Should test Announcements Form for authenticated user", () => {
// login user with the "authenticated" role
cy.loginAs("[email protected]", "b8QW]X9h7#5n");
cy.visit("/node/add/access_news");

//Page Title
cy.get(".page-title").contains("Create ACCESS Announcements");

//Form Title Field
cy.get("#edit-title-0-value").type("Cypress-Created-Annoucement");

//Form Image Field
cy.get("#ajax-wrapper > .claro-details").contains("Featured Image");

//Tags
cy.get("#edit-field-tags-0-target-id").type("login (682)");

//Date for Announcement
cy.get(
"#edit-field-published-date-wrapper > .form-datetime-wrapper"
).contains("Published Date");

//Affiliation Field
cy.get("#edit-field-affiliation").select("Community");

//Save As Field
cy.get('[name="moderation_state[0][state]"]').select("Published");

//Submission and confirmation
cy.get("#edit-submit").click();
cy.contains(
"ACCESS Announcements Cypress-Created-Annoucement has been created."
);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
This test is specifically focused on the Announcements page tested for an unauthenticated user.
This test checks for major functions like:
Filter Functionality,
Headers,
Testing created announcement
*/
describe("Unauthenticated user tests the Announcements Page", () => {
it("Should test the Announcements page for unauthenticated user", () => {
cy.visit("/announcements");

// Look for title of the Announcements page
cy.get(".page-title").contains("Announcements");

// check breadcrumbs
const crumbs = [
["Support", "/"],
["Announcements", null],
];
cy.checkBreadcrumbs(crumbs);

//Filter Section on announcements
cy.get("#edit-field-affiliation-value--2").select("Community"); //Affiliation field
cy.get("#edit-tid--2").select("login"); //Tag field
cy.get("#edit-submit-access-news--2").click(); //Filter button

//Created announcement through cypress
cy.get(".view-content > :nth-child(1)")
.contains("Cypress-Created-Annoucement")
.click();
cy.get(".field__item > .font-normal").contains("login");
cy.get(".field__label").contains("Affiliation");
cy.get(".layout__region--second > .block > .field > .field__item").contains(
"Community"
);

//Testing another announcement
cy.visit("/announcements");
cy.contains("Gateways 2023 Call for Participation").click();
cy.get(".page-title > .field").contains(
"Gateways 2023 Call for Participation"
);
cy.get(".clearfix").contains("https://sciencegateways.org/gateways2023");
});
});
27 changes: 27 additions & 0 deletions tests/cypress/cypress/e2e/accessmatch/ccep/ccep-details.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
This test is specifically focused on the CCEP page tested for an unauthenticated user.
This test checks for major functions like:
Page Title,
Header text,
and a segment of body paragraph
*/

describe("Unauthenticated user tests the CCEP Details Page", () => {
it("Should test CCEP Details page for unauthenticated user", () => {
cy.visit("/ccep-details");

//Verifying page title and paragraph
cy.get(".page-title > .field").contains("CCEP Details");
cy.get("h2 > strong").contains("Important Fine Print:");
cy.get(".block-field-blocknodepagebody > .clearfix").contains(
"All CSSN members (students, faculty, staff, or CI professionals) seeking CCEP rewards need to be affiliated"
);
//Verifying Join CCEP Button
cy.get(".btn")
.contains("APPLY TO CCEP")
.should("have.attr", "href")
.and("contain", "https://forms.gle/u4d4kCtsYNQgzxjq5");
});
});
49 changes: 49 additions & 0 deletions tests/cypress/cypress/e2e/accessmatch/ccep/ccep.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
This test is specifically focused on the CCEP page tested for an unauthenticated user.
This test checks for major functions like:
Page Title,
Testing accordion function,
*/

describe("Unauthenticated user tests the CCEP Page", () => {
it("Should test CCEP page for unauthenticated user", () => {
cy.visit("/ccep");

//Page Intro paragraph
cy.get("#about").contains(
"CCEP (CSSN Community Engagement Program) gives travel rewards to ANYONE"
);
cy.get("#about > :nth-child(2)").contains(
"Submissions are reviewed once a month"
);

//Tier 1 Accordion Section
cy.get("#tier1 > h2").contains("Tier 1: $1,000");
cy.get("#tier1 > :nth-child(2) > .bg-light-teal")
.contains("Intro to ACCESS lecture")
.click();
cy.get('[open=""] > .bg-white').contains(
"Prepare an Intro to ACCESS lecture, tutorial, or slide deck for Basic, Intermediate, or Advanced User."
);

//Apply To CCEP Button
cy.get(".btn")
.contains("Apply to CCEP")
.should("have.attr", "href")
.and("contain", "https://forms.gle/u4d4kCtsYNQgzxjq5");

//Important Fine Print Section
cy.visit("/ccep");
cy.get("#fine-print").contains(
"CCEP (CSSN Community Engagement Program) gives travel rewards to ANYONE for community engagement, feedback forums,"
);

//Testing See All Details click function and Intro text of /ccep/ccep-details
cy.get(".container > :nth-child(3) > a")
.contains("See all the details")
.click();
cy.get(".clearfix > ul > :nth-child(1)").contains(
"All CSSN members (students, faculty, staff"
);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
This test is specifically focused on the Interests Page tested for an authenticated user.
This test checks for major functions like:
Page Title,
Top Level Tag text,
Adding a Tag Functionality
*/

describe("Authenticated user tests the Add Interests without adding an Affinity Group", () => {
it("Should test Add Interests Form for authenticated user", () => {
// login user with the "authenticated" role

cy.loginAs("[email protected]", "6%l7iF}6(4tI");
cy.visit("/community-persona/add-interest");

//Adding Tag
cy.contains("access-account").click();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
This test is specifically focused on the Skills Page tested for an authenticated user.
This test checks for major functions like:
Page Title,
Top Level Tag text,
Adding a Tag Functionality
*/

describe("Authenticated user tests the Add Skills without adding an Affinity Group", () => {
it("Should test Add Skills Form for authenticated user", () => {
// login user with the "authenticated" role

cy.loginAs("[email protected]", "6%l7iF}6(4tI");
cy.visit("/community-persona/add-skill");

//Adding Tag
cy.contains("access-account").click();
});
});
30 changes: 30 additions & 0 deletions tests/cypress/cypress/e2e/accessmatch/cssn/cssn-form.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
This test is specifically focused on the CSSN form page tested for an authenticated user.
This test checks for major functions like:
Page Title,
Header text,
Form Functionality
*/

describe("Authenticated user tests the CSSN Page", () => {
it("Should test CSSN page for authenticated user", () => {
// login user with the "authenticated" role
cy.loginAs("[email protected]", "Pecan");
cy.visit("/form/join-the-cssn-network");

//Page Title
cy.get(".page-title").contains("Join the CSSN Network");

//Selecting a CSSN Role
cy.get("#edit-i-am-joining-as-a-general-member").click();

//Submit Button and Submission confirmation
cy.get("#edit-actions-submit").click();
cy.get(".messages--status").contains(
"Thanks for updating your CSSN membership."
);

//Testing role update in Community Persona Page?
});
});
66 changes: 66 additions & 0 deletions tests/cypress/cypress/e2e/accessmatch/events/events-add.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
This test is specifically focused on the Events form tested for an authenticated user.
This test checks for major functions like:
Page Title,
Header text,
Form Functionality
// cy.get("#edit-field-affinity-group-node-0-target-id").type(
// "Access Support Testing (413)"
// );
*/

describe("Authenticated user tests the Events Form without Affinity Group", () => {
it("Should test Events Form for authenticated user", () => {
// login user with the "authenticated" role
cy.loginAs("[email protected]", "b8QW]X9h7#5n");
cy.visit("/events/add");

//Page Title
cy.get("#block-claro-page-title").contains("Create ACCESS Event");

//User filling out form title
cy.get("#edit-title-0-value").type("example-event");

//Date and Time of Event
cy.get("#edit-recur-type-custom").click();
cy.get("#custom-date-values > thead > tr > .field-label").contains(
"Custom Date(s) and Time(s)"
);
cy.get("#edit-custom-date-0-value-date").type("2026-12-12");
cy.get("#edit-custom-date-0-end-value-date").type("2027-12-12");
cy.get("#edit-custom-date-0-value-time").type("04:30:00");
cy.get("#edit-custom-date-0-end-value-time").type("04:30:00");

//Event Location
cy.get("#edit-field-location-0-value").type("Zoom");

//Event Contact
cy.get("#edit-field-contact-0-value").type("Pecan Pie");

//Registration Link
cy.get("#edit-field-registration-0-uri").type(
"https://test-accessmatch.pantheonsite.io/"
);

//Event Tag
cy.get("#edit-field-tags-0-target-id").type("login (682)");

//Save As Selection
cy.get("#edit-moderation-state-0-state").select("Published");

//Event Type
cy.get("#edit-field-event-type").select("Training");

//Event Affiliation
cy.get("#edit-field-affiliation").select("Community");

//Event Skill Level
cy.get("#edit-field-skill-level").select("Advanced");

//Form Submit Button and confirmation
cy.get("#edit-submit").click();
cy.contains("Successfully saved the example-event event series");
});
});
66 changes: 66 additions & 0 deletions tests/cypress/cypress/e2e/accessmatch/events/events-page.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
This test is specifically focused on the Events page tested for an unauthenticated user.
This test checks for major functions like:
Filter Functionality,
Headers,
Testing created event
Test breadcrumbs
*/
describe("Unauthenticated user tests the Events Page", () => {
it("Should test the EVents page for unauthenticated user", () => {
cy.visit("/events");

//Page title and column headers
cy.get(".page-title").contains("Events & Trainings");
cy.get("#view-title-2-table-column").contains("Title");
cy.get("#view-date-value-1-table-column").contains("Event Date");
cy.get("#view-body-format-table-column").contains("Description");

//Filter feature
cy.get("#edit-field-affiliation-value--2").select("Community"); //Affiliation field
cy.get("#edit-field-event-type-value--2").select("Training"); //Event Type
cy.get("#edit-tid--2").select("login"); //Tag field
cy.get("#edit-field-skill-level-value--2").select("Advanced"); //Skill Level
cy.get("#edit-submit-recurring-events-event-instances--2").click(); //Submit button

//Testing Cypress Created Event
//Event Title
cy.get("tbody > tr > .views-field-title-2")
.contains("example-event")
.click();
cy.get(".page-title > .field").contains("example-event");

//Event Date
cy.get(".field--name-date").contains("Event Date");
cy.get(".field--name-date").contains(
"12/12/26"
);

//Event Location
cy.get(".field--name-location").contains("Location");
cy.get(".field--name-location").contains("Zoom");

//Event Tags
cy.get(".field--name-tags").contains("Tags");
cy.get(".field--name-tags").contains("login");

//Event Contact
cy.get(".field--name-contact").contains("Contact");
cy.get(".field--name-contact").contains("Pecan Pie");

//Registration Button Not sure how to correctly reference the btn
cy.get(".field--name-registration").contains("Registration");
cy.get(".field--name-registration").contains("Register here")
.should("have.attr", "href");

//Event Skill Level
cy.get(".field--name-skill-level").contains("Skill Level");
cy.get(".field--name-skill-level").contains("Advanced");

//Event Type
cy.get(".field--name-event-type").contains("Event Type");
cy.get(".field--name-event-type").contains("Training");
});
});
Loading

0 comments on commit 45bc7a2

Please sign in to comment.