-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1186 from ORCID/fix-more-cy-tests
fix more tests
- Loading branch information
Showing
26 changed files
with
1,258 additions
and
879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,75 @@ | ||
/// <reference types="cypress" /> | ||
import data from '../fixtures/test-data.json'; | ||
import credentials from '../fixtures/credentials.json'; | ||
import data from "../fixtures/test-data.json"; | ||
import credentials from "../fixtures/credentials.json"; | ||
|
||
describe('Add new user', () => { | ||
it('Reset organization owner', () => { | ||
cy.programmaticSignin(credentials.adminEmail, credentials.adminPassword) | ||
cy.changeOrgOwner() | ||
}) | ||
describe("Add new user", () => { | ||
it("Reset organization owner", () => { | ||
cy.programmaticSignin(credentials.adminEmail, credentials.adminPassword); | ||
cy.changeOrgOwner(); | ||
}); | ||
|
||
it('Remove all affiliations from test group', function () { | ||
cy.programmaticSignin(data.member.users.owner.email, credentials.password) | ||
cy.visit('/assertion') | ||
cy.get('.btn-group').each($e => { | ||
cy.wrap($e).children().last().click() | ||
cy.get('#jhi-confirm-delete-assertion').click() | ||
}) | ||
cy.visit('/user') | ||
cy.get('.btn-group').each($e => { | ||
cy.wrap($e).children().last().invoke('attr', 'disabled').then((disabled) => { | ||
disabled ? cy.log("Skipping user, button is disabled") : cy.removeAffiliation($e) | ||
}) | ||
}) | ||
cy.programmaticSignout() | ||
}) | ||
it("Remove all affiliations from test group", function () { | ||
cy.programmaticSignin(data.member.users.owner.email, credentials.password); | ||
cy.visit("/assertion"); | ||
cy.get(".btn-group").each(($e) => { | ||
cy.wrap($e).children().last().click(); | ||
cy.get("button").filter('[data-cy="confirmDeleteAssertion"]').click(); | ||
}); | ||
cy.visit("/user"); | ||
cy.get(".btn-group").each(($e) => { | ||
cy.wrap($e) | ||
.children() | ||
.last() | ||
.invoke("attr", "disabled") | ||
.then((disabled) => { | ||
disabled | ||
? cy.log("Skipping user, button is disabled") | ||
: cy.removeAffiliation($e); | ||
}); | ||
}); | ||
cy.programmaticSignout(); | ||
}); | ||
|
||
it('Remove all affiliations from test member', function () { | ||
cy.programmaticSignin(data.member.users.owner.email, credentials.password) | ||
cy.visit('/user') | ||
cy.get('.btn-group').each($e => { | ||
cy.wrap($e).children().last().invoke('attr', 'disabled').then((disabled) => { | ||
disabled ? cy.log("Skipping user, button is disabled") : cy.removeAffiliation($e) | ||
}) | ||
}) | ||
cy.programmaticSignout() | ||
}) | ||
it("Remove all affiliations from test member", function () { | ||
cy.programmaticSignin(data.member.users.owner.email, credentials.password); | ||
cy.visit("/user"); | ||
cy.get(".btn-group").each(($e) => { | ||
cy.wrap($e) | ||
.children() | ||
.last() | ||
.invoke("attr", "disabled") | ||
.then((disabled) => { | ||
disabled | ||
? cy.log("Skipping user, button is disabled") | ||
: cy.removeAffiliation($e); | ||
}); | ||
}); | ||
cy.programmaticSignout(); | ||
}); | ||
|
||
it('Remove all affiliations from csv test member', function () { | ||
cy.programmaticSignin(data.csvMember.users.owner.email, credentials.password) | ||
cy.visit('/assertion') | ||
cy.get('.btn-group').each($e => { | ||
cy.wrap($e).children().last().click() | ||
cy.get('#jhi-confirm-delete-assertion').click() | ||
}) | ||
cy.programmaticSignout() | ||
}) | ||
it("Remove all affiliations from csv test member", function () { | ||
cy.programmaticSignin( | ||
data.csvMember.users.owner.email, | ||
credentials.password, | ||
); | ||
cy.visit("/assertion"); | ||
cy.get(".btn-group").each(($e) => { | ||
cy.wrap($e).children().last().click(); | ||
cy.get("button").filter('[data-cy="confirmDeleteAssertion"]').click(); | ||
}); | ||
cy.programmaticSignout(); | ||
}); | ||
|
||
it('Remove all affiliations from the notifications member', function() { | ||
cy.programmaticSignin(data.notificationsMember.users.owner.email, credentials.password); | ||
cy.visit('/assertion') | ||
cy.get('.btn-group').each($e => { | ||
cy.wrap($e).children().last().click() | ||
cy.get('#jhi-confirm-delete-assertion').click() | ||
}) | ||
cy.programmaticSignout() | ||
it("Remove all affiliations from the notifications member", function () { | ||
cy.programmaticSignin( | ||
data.notificationsMember.users.owner.email, | ||
credentials.password, | ||
); | ||
cy.visit("/assertion"); | ||
cy.get(".btn-group").each(($e) => { | ||
cy.wrap($e).children().last().click(); | ||
cy.get("button").filter('[data-cy="confirmDeleteAssertion"]').click(); | ||
}); | ||
cy.programmaticSignout(); | ||
}); | ||
}) | ||
}); |
Oops, something went wrong.