-
Notifications
You must be signed in to change notification settings - Fork 1
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 #54 from concord-consortium/187689523-filter-mater…
…ials-collections Filter Materials Collections Automation
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
cypress/e2e/functional/admin_materials_collections_filter.spec.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,57 @@ | ||
import * as c from '../../support/constants.js' | ||
import * as materialsHelper from '../../support/helpers/materialsCollectionsHelper' | ||
|
||
context("Verify the user is able to Filter Materials Collections automatically when using the project dropdown", () => { | ||
|
||
before(function() { | ||
cy.visit(c.LEARN_PORTAL_BASE_URL); // Visit LEARN Portal home page | ||
cy.login(c.ADMIN_USERNAME, c.ADMIN_PASSWORD); // Login as admin user | ||
cy.visit(c.LEARN_PORTAL_BASE_URL + "/materials_collections"); | ||
}); | ||
|
||
after(function() { | ||
cy.logout(); | ||
}); | ||
|
||
it("Verify materials collections filter", () => { | ||
|
||
cy.log("verify material collection page displayed"); | ||
materialsHelper.verifyMaterialsCollectionPage(); | ||
|
||
cy.log("verify initial filter result"); | ||
materialsHelper.verifyFilterResult("all 6"); | ||
|
||
cy.log("verify filter materials collections for project 1"); | ||
materialsHelper.selectProject("Test Project Images"); | ||
materialsHelper.verifyFilterResult("1"); | ||
materialsHelper.verifyMaterialsName("Test Project Images"); | ||
|
||
cy.wait(1000); | ||
|
||
cy.log("verify filter materials collections for project 2"); | ||
materialsHelper.selectProject("Test Project"); | ||
materialsHelper.verifyFilterResult("all 5"); | ||
materialsHelper.verifyMaterialsName("Test Project"); | ||
|
||
cy.wait(1000); | ||
|
||
cy.log("verify filter for no materials collections"); | ||
materialsHelper.selectProject("Test Project For Researcher"); | ||
materialsHelper.verifyFilterResult("No materials collections found"); | ||
|
||
cy.wait(1000); | ||
|
||
cy.log("verify default materials collections"); | ||
materialsHelper.selectProject("Select project..."); | ||
materialsHelper.verifyFilterResult("all 6"); | ||
|
||
cy.log("verify search material collection"); | ||
materialsHelper.enterMaterialsName("Test Project Images"); | ||
materialsHelper.clickSearchButton(); | ||
materialsHelper.verifyFilterResult("1"); | ||
|
||
materialsHelper.enterMaterialsName("Test Project"); | ||
materialsHelper.clickSearchButton(); | ||
materialsHelper.verifyFilterResult("all 3"); | ||
}); | ||
}); |
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,23 @@ | ||
export function verifyMaterialsCollectionPage(){ | ||
cy.get('#content .action_menu_header .action_menu_header_right a').contains("create Materials Collection"); | ||
} | ||
|
||
export function verifyFilterResult(count){ | ||
cy.get('.action_menu_header .action_menu_header_left p').contains(count); | ||
} | ||
|
||
export function selectProject(project){ | ||
cy.get('#project_id').select(project); | ||
} | ||
|
||
export function verifyMaterialsName(name){ | ||
cy.get('.list-item-wrapper .action_menu_header_left a').contains(name); | ||
} | ||
|
||
export function enterMaterialsName(name){ | ||
cy.get('.action_menu_header_left #search').clear().type(name); | ||
} | ||
|
||
export function clickSearchButton(){ | ||
cy.get('.action_menu_header_left input').eq(1).click({ force: true }); | ||
} |