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

clean up e2e tests #1192

Merged
merged 1 commit into from
May 22, 2024
Merged
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
12 changes: 0 additions & 12 deletions ui/cypress/e2e/retention/restricted-access.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,4 @@ describe("Test restricted access", () => {
.invoke("attr", "hidden")
.should("not.exist");
});

/* it('Anonymous users cannot access anything', function() {
cy.visit('/assertion');
cy.get('h1').filter('[data-cy="cannotProcessRequest"]').contains('Your request cannot be processed')
cy.get('div').filter('[data-cy="notAuthorized"]').invoke('attr', 'hidden').should('not.exist')
cy.visit('/user');
cy.get('h1').filter('[data-cy="cannotProcessRequest"]').contains('Your request cannot be processed')
cy.get('div').filter('[data-cy="notAuthorized"]').invoke('attr', 'hidden').should('not.exist')
cy.visit('/member');
cy.get('h1').filter('[data-cy="cannotProcessRequest"]').contains('Your request cannot be processed')
cy.get('div').filter('[data-cy="notAuthorized"]').invoke('attr', 'hidden').should('not.exist')
}); */
});
11 changes: 0 additions & 11 deletions ui/cypress/e2e/retention/ui-authorities.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,4 @@ describe("Test authorities", () => {
// TODO: Awaiting endpoint changes
cy.getAssertions(200);
});

// TODO: enable once the issue with signed out users not being able to visit routes is fixed
it("Anonymous", function () {
cy.programmaticSignin(credentials.adminEmail, credentials.adminPassword);
cy.visit("ui/en/");
cy.get("#admin-menu").should("not.exist");
cy.get("#entity-menu").should("not.exist");
cy.get("a").filter('[routerLink="/users"]').should("not.exist");
cy.get("a").filter('[routerLink="/affiliations"]').should("not.exist");
cy.get("a").filter('[routerLink="/members"]').should("not.exist");
});
});
10 changes: 0 additions & 10 deletions ui/cypress/e2e/retention/ui-pagination.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ describe("Test pagination", () => {

it('Test the "Manage users" page', function () {
cy.visit("ui/en/users");
/*
cy.get('.container-fluid').within(() => {
cy.get('p')
.contains('Showing 1 - 20 of 22 items')
})*/
cy.get("tbody").children().should("have.length", 20);
cy.get(".pagination").contains("1");
cy.get(".pagination").contains("3").should("not.exist");
Expand All @@ -37,11 +32,6 @@ describe("Test pagination", () => {

it('Test the "Affiliations" page', function () {
cy.visit("ui/en/affiliations");
/*
cy.get('.container-fluid').within(() => {
cy.get('p')
.contains('Showing 1 - 20 of 22 items')
})*/
cy.get("tbody").children().should("have.length", 20);
cy.get(".pagination").contains("1");
cy.get(".pagination").contains("2");
Expand Down
14 changes: 7 additions & 7 deletions ui/cypress/fixtures/editAffiliations.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
email,affiliation-section,department-name,role-title,start-date,end-date,org-name,org-country,org-city,org-region,disambiguation-source,disambiguated-organization-identifier,external-id,external-id-type,external-id-url,url,id
[email protected],INVITED_POSITION," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 "," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",AL," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,ROR,https://ror.org/04z60tq39,,,,,626bcaacadbe1d00081abab3
[email protected],DISTINCTION," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 "," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",AL," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,ROR,https://ror.org/04z60tq39,,,,,626bcadbadbe1d00081abab4
[email protected],MEMBERSHIP," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 "," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",AL," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,ROR,https://ror.org/04z60tq39,,,,,626bcaf3adbe1d00081abab5
[email protected],SERVICE," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 "," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",AL," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,ROR,https://ror.org/04z60tq39,,,,,626bcb07adbe1d00081abab6
[email protected],QUALIFICATION," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 "," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",AL," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,ROR,https://ror.org/04z60tq39,,,,,626bcb67adbe1d00081abab7
[email protected],EMPLOYMENT," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 "," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",AL," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,ROR,https://ror.org/04z60tq39,,,,,626bcb7dadbe1d00081abab8
[email protected],EDUCATION," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 "," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",AL," !@#$%^&*()-=_ 斯的 2024-05-20t16-45-52 ",,ROR,https://ror.org/04z60tq39,,,,,626bc955adbe1d00081abaaf
[email protected],INVITED_POSITION," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 "," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",AL," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,ROR,https://ror.org/04z60tq39,,,,,626bcaacadbe1d00081abab3
[email protected],DISTINCTION," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 "," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",AL," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,ROR,https://ror.org/04z60tq39,,,,,626bcadbadbe1d00081abab4
[email protected],MEMBERSHIP," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 "," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",AL," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,ROR,https://ror.org/04z60tq39,,,,,626bcaf3adbe1d00081abab5
[email protected],SERVICE," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 "," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",AL," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,ROR,https://ror.org/04z60tq39,,,,,626bcb07adbe1d00081abab6
[email protected],QUALIFICATION," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 "," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",AL," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,ROR,https://ror.org/04z60tq39,,,,,626bcb67adbe1d00081abab7
[email protected],EMPLOYMENT," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 "," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",AL," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,ROR,https://ror.org/04z60tq39,,,,,626bcb7dadbe1d00081abab8
[email protected],EDUCATION," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 "," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",AL," !@#$%^&*()-=_ 經航 2024-05-21t13-47-19 ",,ROR,https://ror.org/04z60tq39,,,,,626bc955adbe1d00081abaaf
6 changes: 3 additions & 3 deletions ui/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import credentials from "../fixtures/credentials.json";
import record from "../fixtures/orcid-record.json";

Cypress.Commands.add("signin", (email, password) => {
cy.visit("./");
cy.visit("ui/en/");
cy.get("#username")
.clear()
.type(email)
Expand All @@ -54,7 +54,7 @@ Cypress.Commands.add("programmaticSignin", (username, password) => {
cy.getCookie("XSRF-TOKEN").then((csrfCookie) => {
if (!csrfCookie) {
return cy
.visit("/")
.visit("ui/en/")
.getCookie("XSRF-TOKEN")
.then(() => cy.programmaticSignin(username, password));
} else {
Expand Down Expand Up @@ -161,7 +161,7 @@ Cypress.Commands.add("removeAffiliation", ($e) => {
});

Cypress.Commands.add("changeOrgOwner", () => {
cy.visit(`/user/${data.member.users.owner.id}/edit`);
cy.visit(`ui/en/users/${data.member.users.owner.id}/edit`);
cy.get("#field_mainContact").click();
cy.get("#save-entity").click();
cy.get(".alert-success").should("exist");
Expand Down
Loading