-
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 #14 from concord-consortium/187305230-lara-automation
LARA Automation
Showing
8 changed files
with
594 additions
and
4 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,66 @@ | ||
import AuthoringPage from "../../support/authoring-page.cy.js"; | ||
import BarGraphAuthoringPage from "../../support/bar-graph-authoring.cy.js"; | ||
|
||
const authoringPage = new AuthoringPage; | ||
const barGraphAuthoringPage = new BarGraphAuthoringPage; | ||
|
||
context("Test Authoring Preview", () => { | ||
before(() => { | ||
cy.visit(""); | ||
cy.loginLARAWithSSO(Cypress.config().username, Cypress.env("password")); | ||
authoringPage.launchActivity("Test Automation Bar Graph Activity"); | ||
cy.deleteItem(); | ||
}); | ||
|
||
describe("LARA Bar Graph Authoring Preview", () => { | ||
it("Add Bar Graph Item", () => { | ||
authoringPage.getAddItem().click(); | ||
authoringPage.getItemPickerSearch().type("Bar Graph"); | ||
authoringPage.getItemPickerList().contains("Bar Graph AWS S3").click(); | ||
authoringPage.getAddItemButton().click(); | ||
authoringPage.getEditItemDialog().should("exist"); | ||
authoringPage.getNameField().type("Bar Graph Question"); | ||
authoringPage.getPromptField(" Bar Graphe Prompt"); | ||
authoringPage.getHintField(" Bar Graph Hint"); | ||
barGraphAuthoringPage.getGraphTitleField("Graph Title"); | ||
barGraphAuthoringPage.getXAxisLabelField("X axis label"); | ||
barGraphAuthoringPage.getYAxisLabelField("Y axis label"); | ||
barGraphAuthoringPage.getShowValuesAboveBarsCheckbox().click(); | ||
barGraphAuthoringPage.getBarsAddButton().click(); | ||
barGraphAuthoringPage.getBarLabel(0, "Bar 1"); | ||
barGraphAuthoringPage.getBarValue(0, "10"); | ||
barGraphAuthoringPage.getBarsAddButton().click(); | ||
barGraphAuthoringPage.getBarLabel(1, "Bar 2"); | ||
barGraphAuthoringPage.getBarValue(1, "20"); | ||
cy.wait(2000); | ||
authoringPage.getSaveButton().click(); | ||
}); | ||
it("Verify Added Bar Graph Item In Authoring Preview", () => { | ||
cy.wait(6000); | ||
authoringPage.getSectionItemHeader().should("contain", "Bar Graph Question"); | ||
barGraphAuthoringPage.verifyAuthoringPreviewPrompt("Bar Graphe Prompt"); | ||
barGraphAuthoringPage.verifyAuthoringPreviewTitle("Graph Title"); | ||
barGraphAuthoringPage.verifyAuthoringPreviewXAxisLabel("X axis label"); | ||
barGraphAuthoringPage.verifyAuthoringPreviewYAxisLabel("Y axis label"); | ||
barGraphAuthoringPage.verifyAuthoringPreviewBarValue(0, "10"); | ||
barGraphAuthoringPage.verifyAuthoringPreviewBarValue(1, "20"); | ||
|
||
}); | ||
it("Verify Added Bar Graph Item In Item Preview", () => { | ||
cy.wait(2000); | ||
authoringPage.getSectionMenuEdit().click(); | ||
cy.wait(6000); | ||
barGraphAuthoringPage.verifyEditItemPreviewPrompt("Bar Graphe Prompt"); | ||
barGraphAuthoringPage.verifyEditItemPreviewTitle("Graph Title"); | ||
barGraphAuthoringPage.verifyEditItemPreviewXAxisLabel("X axis label"); | ||
barGraphAuthoringPage.verifyEditItemPreviewYAxisLabel("Y axis label"); | ||
barGraphAuthoringPage.verifyEditItemPreviewBarValue(0, "10"); | ||
barGraphAuthoringPage.verifyEditItemPreviewBarValue(1, "20"); | ||
authoringPage.getSaveButton().click(); | ||
}); | ||
it("Delete Item", () => { | ||
cy.wait(6000); | ||
authoringPage.getSectionMenuDelete().click(); | ||
}); | ||
}); | ||
}); |
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 AuthoringPage from "../../support/authoring-page.cy.js"; | ||
import ImageInteractiveAuthoringPage from "../../support/image-interactive-authoring.cy.js"; | ||
|
||
const authoringPage = new AuthoringPage; | ||
const imageInteractiveAuthoringPage = new ImageInteractiveAuthoringPage; | ||
|
||
context("Test Authoring Preview", () => { | ||
before(() => { | ||
cy.visit(""); | ||
cy.loginLARAWithSSO(Cypress.config().username, Cypress.env("password")); | ||
authoringPage.launchActivity("Test Automation Image Interactive Activity"); | ||
cy.deleteItem(); | ||
}); | ||
|
||
describe("LARA Image Interactive Authoring Preview", () => { | ||
it("Add Image Interactive Item", () => { | ||
authoringPage.getAddItem().click(); | ||
authoringPage.getItemPickerSearch().type("Image Interactive"); | ||
authoringPage.getItemPickerList().contains("Image Interactive AWS").click(); | ||
authoringPage.getAddItemButton().click(); | ||
authoringPage.getEditItemDialog().should("exist"); | ||
authoringPage.getNameField().type("Image Interactive Question"); | ||
imageInteractiveAuthoringPage.getURLField("https://learn-resources.concord.org/tutorials/images/brogan-acadia.jpg"); | ||
imageInteractiveAuthoringPage.getAltTextField("Image Alt Text"); | ||
imageInteractiveAuthoringPage.getCaptionField("Image Caption"); | ||
imageInteractiveAuthoringPage.getCreditField("Image Credit"); | ||
imageInteractiveAuthoringPage.getExportToMediaLibraryCheckbox().should("exist"); | ||
cy.wait(2000); | ||
authoringPage.getSaveButton().click(); | ||
}); | ||
it("Verify Added Image Interactive In Authoring Preview", () => { | ||
cy.wait(6000); | ||
authoringPage.getSectionItemHeader().should("contain", "Image Interactive Question"); | ||
imageInteractiveAuthoringPage.verifyAuthoringPreviewImage("https://learn-resources.concord.org/tutorials/images/brogan-acadia.jpg"); | ||
imageInteractiveAuthoringPage.verifyAuthoringPreviewImageAltText("Image Alt Text"); | ||
imageInteractiveAuthoringPage.verifyAuthoringPreviewCaption("Image Caption"); | ||
imageInteractiveAuthoringPage.verifyAuthoringPreviewCredit("Image Credit"); | ||
imageInteractiveAuthoringPage.getZoomInIcon().should("exist"); | ||
|
||
}); | ||
it("Verify Added Image Interactive In Item Preview", () => { | ||
cy.wait(2000); | ||
authoringPage.getSectionMenuEdit().click(); | ||
cy.wait(6000); | ||
imageInteractiveAuthoringPage.verifyEditItemPreviewImage("https://learn-resources.concord.org/tutorials/images/brogan-acadia.jpg"); | ||
imageInteractiveAuthoringPage.verifyEditItemPreviewImageAltText("Image Alt Text"); | ||
imageInteractiveAuthoringPage.verifyEditItemPreviewCaption("Image Caption"); | ||
imageInteractiveAuthoringPage.verifyEditItemPreviewCredit("Image Credit"); | ||
imageInteractiveAuthoringPage.getEditItemZoomInIcon().should("exist"); | ||
authoringPage.getSaveButton().click(); | ||
}); | ||
it("Delete Item", () => { | ||
cy.wait(6000); | ||
authoringPage.getSectionMenuDelete().click(); | ||
}); | ||
}); | ||
}); |
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,57 @@ | ||
import AuthoringPage from "../../support/authoring-page.cy.js"; | ||
import VideoInteractiveAuthoringPage from "../../support/video-interactive-authoring.cy.js"; | ||
|
||
const authoringPage = new AuthoringPage; | ||
const videoInteractiveAuthoringPage = new VideoInteractiveAuthoringPage; | ||
|
||
context("Test Authoring Preview", () => { | ||
before(() => { | ||
cy.visit(""); | ||
cy.loginLARAWithSSO(Cypress.config().username, Cypress.env("password")); | ||
authoringPage.launchActivity("Test Automation Video Interactive Activity"); | ||
cy.deleteItem(); | ||
}); | ||
|
||
describe("LARA Video Interactive Authoring Preview", () => { | ||
it("Add Video Interactive Item", () => { | ||
authoringPage.getAddItem().click(); | ||
authoringPage.getItemPickerSearch().type("Video Player"); | ||
authoringPage.getItemPickerList().contains("Video Player AWS").click(); | ||
authoringPage.getAddItemButton().click(); | ||
authoringPage.getEditItemDialog().should("exist"); | ||
authoringPage.getNameField().type("Video Player Question"); | ||
videoInteractiveAuthoringPage.getVideoURLField("https://cc-project-resources.s3.amazonaws.com/waters/Glossary/movies/aquatic.mp4"); | ||
videoInteractiveAuthoringPage.getVideoCaptionURLField("https://project-resources.concord.org/waters/Lesson1/Movies/L1USDAWatershedLearningVideo.vtt"); | ||
videoInteractiveAuthoringPage.getDescriptionField("Video Description"); | ||
videoInteractiveAuthoringPage.getCaptionField("Video Caption"); | ||
videoInteractiveAuthoringPage.getCreditField("Video Credit"); | ||
cy.wait(2000); | ||
authoringPage.getSaveButton().click(); | ||
}); | ||
it("Verify Added Video Interactive In Authoring Preview", () => { | ||
cy.wait(6000); | ||
authoringPage.getSectionItemHeader().should("contain", "Video Player Question"); | ||
videoInteractiveAuthoringPage.verifyAuthoringPreviewVideo("https://cc-project-resources.s3.amazonaws.com/waters/Glossary/movies/aquatic.mp4"); | ||
videoInteractiveAuthoringPage.getAuthoringPreviewPlayButton().should("exist"); | ||
videoInteractiveAuthoringPage.verifyAuthoringPreviewDescription("Video Description"); | ||
videoInteractiveAuthoringPage.verifyAuthoringPreviewCaption("Video Caption"); | ||
videoInteractiveAuthoringPage.verifyAuthoringPreviewCredit("Video Credit"); | ||
|
||
}); | ||
it("Verify Added Video Interactive In Item Preview", () => { | ||
cy.wait(2000); | ||
authoringPage.getSectionMenuEdit().click(); | ||
cy.wait(6000); | ||
videoInteractiveAuthoringPage.verifyEditItemPreviewVideo("https://cc-project-resources.s3.amazonaws.com/waters/Glossary/movies/aquatic.mp4"); | ||
videoInteractiveAuthoringPage.getEditItemPreviewPlayButton().should("exist"); | ||
videoInteractiveAuthoringPage.verifyEditItemPreviewDescription("Video Description"); | ||
videoInteractiveAuthoringPage.verifyEditItemPreviewCaption("Video Caption"); | ||
videoInteractiveAuthoringPage.verifyEditItemPreviewCredit("Video Credit"); | ||
authoringPage.getSaveButton().click(); | ||
}); | ||
it("Delete Item", () => { | ||
cy.wait(6000); | ||
authoringPage.getSectionMenuDelete().click(); | ||
}); | ||
}); | ||
}); |
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,138 @@ | ||
class BarGraphAuthoringPage { | ||
getEditItemDialog() { | ||
return cy.get(".modalContainer.itemEditDialog"); | ||
} | ||
|
||
getEditItemForm() { | ||
return this.getEditItemDialog().find('#itemEditForm'); | ||
} | ||
|
||
getEditItemPreview() { | ||
return this.getEditItemDialog().find('.itemEditPreview'); | ||
} | ||
getGraphTitleField(title) { | ||
cy.wait(500); | ||
this.getEditItemForm().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('#root_title').type(title); | ||
}); | ||
} | ||
getXAxisLabelField(label) { | ||
cy.wait(500); | ||
this.getEditItemForm().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('#root_xAxisLabel').type(label); | ||
}); | ||
} | ||
getYAxisLabelField(label) { | ||
cy.wait(500); | ||
this.getEditItemForm().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('#root_yAxisLabel').type(label); | ||
}); | ||
} | ||
getShowValuesAboveBarsCheckbox() { | ||
cy.wait(500); | ||
return this.getEditItemForm().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('#root_showValuesAboveBars'); | ||
}); | ||
} | ||
getBarsAddButton() { | ||
cy.wait(500); | ||
return this.getEditItemForm().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('#root_bars .btn-add'); | ||
}); | ||
} | ||
getBarLabel(index, label) { | ||
cy.wait(500); | ||
this.getEditItemForm().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('#root_bars_'+index+'_label').type(label); | ||
}); | ||
} | ||
getBarValue(index, value) { | ||
cy.wait(500); | ||
this.getEditItemForm().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('#root_bars_'+index+'_value').type(value); | ||
}); | ||
} | ||
|
||
//*************************************************************************************************************** | ||
|
||
getInteractive() { | ||
return cy.get(".itemsContainer .sectionItemContainer"); | ||
} | ||
verifyAuthoringPreviewPrompt(prompt) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('.base-app--runtime--question-int').should("contain", prompt); | ||
}); | ||
} | ||
verifyAuthoringPreviewTitle(title) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('[data-cy=title]').should("contain", title); | ||
}); | ||
} | ||
verifyAuthoringPreviewXAxisLabel(label) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('[data-cy=xAxisLabel]').should("contain", label); | ||
}); | ||
} | ||
verifyAuthoringPreviewYAxisLabel(label) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('[data-cy=yAxisLabel]').should("contain", label); | ||
}); | ||
} | ||
verifyAuthoringPreviewBarValue(index, value) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('[data-cy=barValue'+index+']').should("contain", value); | ||
}); | ||
} | ||
|
||
//*************************************************************************************************************** | ||
|
||
getEditItemPreview() { | ||
return this.getEditItemDialog().find('.itemEditPreview'); | ||
} | ||
|
||
verifyEditItemPreviewPrompt(prompt) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('.base-app--runtime--question-int').should("contain", prompt); | ||
}); | ||
} | ||
verifyEditItemPreviewTitle(title) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('[data-cy=title]').should("contain", title); | ||
}); | ||
} | ||
verifyEditItemPreviewXAxisLabel(label) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('[data-cy=xAxisLabel]').should("contain", label); | ||
}); | ||
} | ||
verifyEditItemPreviewYAxisLabel(label) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('[data-cy=yAxisLabel]').should("contain", label); | ||
}); | ||
} | ||
verifyEditItemPreviewBarValue(index, value) { | ||
this.getInteractive().find('iframe').then($iframe => { | ||
const $body = $iframe.contents().find('#app') | ||
cy.wrap($body).find('[data-cy=barValue'+index+']').should("contain", value); | ||
}); | ||
} | ||
|
||
|
||
} | ||
export default BarGraphAuthoringPage; |
Oops, something went wrong.