-
Notifications
You must be signed in to change notification settings - Fork 0
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 #438 from VTUL/cy-version-upgrade
cypress 13 migration
- Loading branch information
Showing
38 changed files
with
1,829 additions
and
1,808 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defineConfig } from 'cypress' | ||
|
||
export default defineConfig({ | ||
chromeWebSecurity: false, | ||
e2e: { | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
baseUrl: 'http://localhost:3000/', | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
describe("language_config.spec: Selecting English loads English results", () => { | ||
it("Language checkbox exists and updates url", () => { | ||
cy.visit("/search"); | ||
cy.wait(2000); | ||
cy.get("div.facet-fields") | ||
.find("div.category > div > h3 > button#category") | ||
.click({ force: true }) | ||
.invoke("text") | ||
.should("equal", "Category"); | ||
cy.get("input#archive", { timeout: 2000 }).click(); | ||
cy.get("div.facet-fields") | ||
.find("div.language > div > h3 > button#language") | ||
.click({ force: true }) | ||
.invoke("text") | ||
.should("equal", "Language"); | ||
cy.get("input#en", { timeout: 2000 }).click(); | ||
cy.wait(2000); | ||
cy.url().should("include", "language=en"); | ||
}); | ||
|
||
it("Items should now be English", () => { | ||
cy.visit("/search"); | ||
cy.wait(2000); | ||
cy.get("div.facet-fields") | ||
.find("div.category > div > h3 > button#category") | ||
.click({ force: true }) | ||
.invoke("text") | ||
.should("equal", "Category"); | ||
cy.get("input#archive", { timeout: 2000 }).click(); | ||
cy.get("div.facet-fields") | ||
.find("div.language > div > h3 > button#language") | ||
.click({ force: true }) | ||
.invoke("text") | ||
.should("equal", "Language"); | ||
cy.get("input#en", { timeout: 2000 }).click(); | ||
cy.get("div.gallery-item > div.card > a").first().click({ force: true }); | ||
cy.wait(2000); | ||
cy.url().should("include", "/archive/"); | ||
cy.get( | ||
'div.details-section-metadata > table[aria-label="Item Metadata"] tbody', | ||
{ timeout: 5000 } | ||
) | ||
.find("tr.language td a", { timeout: 5000 }) | ||
.invoke("text") | ||
.should("equal", "English"); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
cypress/integration/richSchemaTools.spec.js → ...ess/e2e/integration/richSchemaTools.cy.js
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
File renamed without changes.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
describe("admin_archive_edit: Update item metadata and change it back", function () { | ||
before(() => { | ||
cy.signIn(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.visit("/siteAdmin").wait(2000); | ||
|
||
cy.get("li.updateArchive > a").click(); | ||
|
||
cy.get("input.identifier-field") | ||
.clear() | ||
.type("Ms1990_025_Per_Ph_B001_F001_003_demo"); | ||
cy.contains("Confirm").click().wait(2000); | ||
}); | ||
|
||
after(() => { | ||
cy.clearLocalStorageSnapshot(); | ||
cy.clearLocalStorage(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
it("Unable to empty required metadata", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("div[class='required field']") | ||
.first() | ||
.find("textarea") | ||
.clear() | ||
.type(" "); | ||
cy.contains("Update Item Metadata").click(); | ||
cy.contains("Please fill in the required field!").should("be.visible"); | ||
}); | ||
|
||
it("Update single-valued metadata", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("textarea[name='title']").clear().type("New Title"); | ||
cy.contains("Update Item Metadata").click(); | ||
cy.contains("Title: New Title", { timeout: 5000 }).should("be.visible"); | ||
cy.contains("View Item") | ||
.should("have.attr", "href") | ||
.and("include", "/archive/3h85z50c"); | ||
}); | ||
|
||
it("Change single-valued metadata back", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("textarea[name='title']") | ||
.clear() | ||
.type("Unidentified building site, c. 1979. Photographs (Ms1990-025)"); | ||
cy.contains("Update Item Metadata").click(); | ||
cy.contains( | ||
"Title: Unidentified building site, c. 1979. Photographs (Ms1990-025)" | ||
).should("be.visible"); | ||
}); | ||
|
||
it("Can delete single-valued metadata", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("textarea[name='start_date']").clear(); | ||
cy.contains("Update Item Metadata").click(); | ||
cy.contains("Start date:").should("not.exist"); | ||
}); | ||
|
||
it("Can add single-valued metadata", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("textarea[name='start_date']").clear().type("1979/03/23"); | ||
cy.contains("Update Item Metadata").click(); | ||
cy.contains("Start date: 1979/03/23").should("be.visible"); | ||
}); | ||
|
||
it("Can delete multi-valued metadata", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("textarea[name='is_part_of_1']").siblings(".deleteValue").click(); | ||
cy.contains("Update Item Metadata").click(); | ||
cy.contains("Ms1990-025, Box 1, Folder 1").should("not.exist"); | ||
}); | ||
|
||
it("Can add multi-valued metadata", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("#is_part_of_add_value_button").click(); | ||
cy.get("textarea[name='is_part_of_1']") | ||
.should("have.value", "new is_part_of") | ||
.clear() | ||
.type("Ms1990-025, Box 1, Folder 1"); | ||
cy.contains("Update Item Metadata").click(); | ||
cy.contains("Ms1990-025, Box 1, Folder 1").should("be.visible"); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
describe("admin_collection_edit: Update collection metadata and change it back", function () { | ||
before(() => { | ||
cy.signIn(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.visit("/siteAdmin"); | ||
|
||
cy.get("#content-wrapper > div > div > ul", { timeout: 2000 }) | ||
.find(".collectionFormLink > a") | ||
.contains("New / Update Collection") | ||
.click(); | ||
cy.url().should("include", "/siteAdmin"); | ||
|
||
cy.get("input").clear().type("Ms1988_017_Pfeiffer_demo"); | ||
cy.contains("Confirm").click(); | ||
cy.get("input[value='view']").parent().find("input").should("be.checked"); | ||
cy.contains( | ||
"Alberta Pfeiffer’s architectural career spanned 55 years, where she worked primarily in Hadlyme, Connecticut." | ||
).should("be.visible"); | ||
}); | ||
|
||
after(() => { | ||
cy.clearLocalStorageSnapshot(); | ||
cy.clearLocalStorage(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
it("Update single-valued metadata", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("textarea[name='title']").invoke("val", ""); | ||
cy.get("textarea[name='title']").type("New Title"); | ||
cy.contains("Update Collection Metadata").click(); | ||
cy.contains("New Title").should("be.visible"); | ||
}); | ||
|
||
it("Change single-valued metadata back", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("textarea[name='title']") | ||
.clear() | ||
.type( | ||
"Alberta Pfeiffer Architectural Collection, 1929-1976 (Ms1988-017)" | ||
); | ||
cy.contains("Update Collection Metadata").click(); | ||
cy.contains( | ||
"Alberta Pfeiffer Architectural Collection, 1929-1976 (Ms1988-017)" | ||
).should("be.visible"); | ||
}); | ||
}); |
113 changes: 113 additions & 0 deletions
113
cypress/e2e/site_admin/collectionpage_filter_sort_config.cy.js
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 |
---|---|---|
@@ -0,0 +1,113 @@ | ||
describe("admin_collectionpage_filter_sort_config: Displays and updates browse collections page configurations", () => { | ||
before(() => { | ||
cy.signIn(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.visit("/siteAdmin"); | ||
|
||
cy.get("#content-wrapper > div > div > ul") | ||
.find(":nth-child(6) > a") | ||
.contains("Browse Collections Page") | ||
.click(); | ||
cy.url().should("include", "/siteAdmin"); | ||
}); | ||
|
||
after(() => { | ||
cy.clearLocalStorageSnapshot(); | ||
cy.clearLocalStorage(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
describe("admin_collectionpage_filter_sort_config: Displays filter and sort fields", () => { | ||
it("Displays filter field", () => { | ||
cy.get("input[value='view']").parent().click(); | ||
cy.contains("Filter Field: subject").should("be.visible"); | ||
cy.contains("Values:").should("be.visible"); | ||
cy.contains("All").should("be.visible"); | ||
}); | ||
|
||
it("Displays sort fields", () => { | ||
cy.get("input[value='view']").parent().click(); | ||
cy.contains("Sort Field: title").should("be.visible"); | ||
cy.contains("Sort Direction: asc").should("be.visible"); | ||
cy.contains("Sort Field: title").should("be.visible"); | ||
cy.contains("Sort Direction: desc").should("be.visible"); | ||
cy.contains("Sort Field: start_date").should("be.visible"); | ||
cy.contains("Sort Direction: desc").should("be.visible"); | ||
}); | ||
}); | ||
|
||
describe("admin_collectionpage_filter_sort_config: Updates filter's value and changes it back", () => { | ||
it("Updates filter's value", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("input[name='filter_value_2']") | ||
.first() | ||
.clear() | ||
.type("Infrastructure"); | ||
cy.contains("Update Filter and Sort Fields").click(); | ||
cy.contains("Infrastructure").should("be.visible"); | ||
}); | ||
|
||
it("Reverses update", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("input[name='filter_value_2']") | ||
.first() | ||
.clear() | ||
.type("Architecture"); | ||
cy.contains("Update Filter and Sort Fields").click(); | ||
cy.contains("Infrastructure").should("not.exist"); | ||
cy.contains("Architecture").should("be.visible"); | ||
}); | ||
}); | ||
|
||
describe("admin_collectionpage_filter_sort_config: Adds filter's value and removes it", () => { | ||
it("Adds filter's value", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.contains("Add Value").first().click(); | ||
cy.get("input[name='filter_value_6']") | ||
.first() | ||
.clear() | ||
.type("Infrastructure"); | ||
cy.contains("Update Filter and Sort Fields").click(); | ||
cy.contains("Infrastructure").should("be.visible"); | ||
}); | ||
|
||
it("Removes the added filter value", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("input[name='filter_value_6']") | ||
.parent() | ||
.parent() | ||
.parent() | ||
.contains("X") | ||
.click(); | ||
cy.contains("Update Filter and Sort Fields").click(); | ||
cy.contains("Infrastructure").should("not.exist"); | ||
}); | ||
}); | ||
|
||
describe("admin_collectionpage_filter_sort_config: Adds a new sort field and removes it", () => { | ||
it("Adds a new sort field", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get("select").select("identifier (asc)"); | ||
cy.contains("Add New Sort Field").click(); | ||
cy.contains("Update Filter and Sort Fields").click(); | ||
cy.contains("Sort Field: identifier").should("be.visible"); | ||
}); | ||
|
||
it("Removes the newly added sort field", () => { | ||
cy.get("input[value='edit']").parent().click(); | ||
cy.get( | ||
"#content-wrapper > div > div > div > form > ul > section#identifier_sort_section > div.deletePageWrapper > a.deletePage" | ||
) | ||
.contains("Delete Sort Field") | ||
.click(); | ||
cy.contains("Update Filter and Sort Fields").click(); | ||
cy.contains("Sort Field: identifier").should("not.exist"); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.