-
Notifications
You must be signed in to change notification settings - Fork 356
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
[WIP] Cypress on Travis #7201
Closed
Closed
[WIP] Cypress on Travis #7201
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0904e07
[webpack] Add integration env
NickLaMuro 4d52a4f
[ui_tasks.rake] Use app_prefix trick
NickLaMuro 1fbcc60
Add cypress.rake
NickLaMuro 4ea6106
[cypress/support/index.js] No screenshots on CI
NickLaMuro 4a37dc3
[Rakefile] Add spec:cypress task
NickLaMuro f990a16
[tools/ci] Support spec:cypress
NickLaMuro 90add95
[WIP][.travis.yml] Enable spec:cypress
NickLaMuro d2facc2
[POC] Setup Rake task
NickLaMuro 0b81ff8
[cypress] Breakup and remove commands.js
NickLaMuro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,3 @@ | ||
{ | ||
"disable_screenshots": "true" | ||
} |
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,3 @@ | ||
{ | ||
"disable_screenshots": "false" | ||
} |
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 |
---|---|---|
|
@@ -21,3 +21,4 @@ config/webpack/paths.json | |
*.sw[po] | ||
cypress/screenshots | ||
cypress/videos | ||
cypress.env.json |
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,11 @@ | ||
// Note: You must restart bin/webpack-dev-server for changes to take effect | ||
|
||
/* eslint global-require: 0 */ | ||
|
||
const { env } = require('process') | ||
|
||
if (env.CYPRESS_DEV) { | ||
module.exports = require('./development.js') | ||
} else { | ||
module.exports = require('./production.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
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,7 @@ | ||
Cypress.Commands.add("expect_explorer_title", (text) => { | ||
return cy.get('#explorer_title_text').contains(text); | ||
}); | ||
|
||
Cypress.Commands.add("expect_show_list_title", (text) => { | ||
return cy.get('#main-content h1').contains(text); | ||
}); |
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
// cy.accordion('Catalog Items') - click accordion, unless already expanded | ||
Cypress.Commands.add('accordion', (text) => { | ||
cy.get('#main-content'); // ensure screen loads first | ||
|
||
let ret = cy.get('#accordion') | ||
.find('.panel-title a') | ||
.contains(new RegExp(`^${text}$`)) | ||
|
||
ret.then((el) => { | ||
// do not collapse if expanded | ||
if (el.is('.collapsed')) { | ||
el.click(); | ||
} | ||
return el; | ||
}); | ||
|
||
return ret.parents('.panel'); | ||
}); |
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,22 @@ | ||
// GTL related helpers | ||
Cypress.Commands.add("gtl_error", () => { | ||
return cy.get('#miq-gtl-view > #flash_msg_div').should('be.visible'); | ||
}); | ||
|
||
Cypress.Commands.add("gtl_no_record", () => { | ||
return cy.get('#miq-gtl-view > div.no-record').should('be.visible'); | ||
}); | ||
|
||
Cypress.Commands.add("gtl", () => { | ||
cy.get('#miq-gtl-view').then($gtlTile => { | ||
if ($gtlTile.find("miq-tile-view").length > 0) { | ||
return cy.get("div[pf-card-view] > .card-view-pf > .card"); | ||
} else { | ||
return cy.get('#miq-gtl-view > miq-data-table > div > table'); | ||
}; | ||
}); | ||
}); | ||
|
||
Cypress.Commands.add("gtl_click", (name) => { | ||
cy.gtl().contains(name).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,10 @@ | ||
// cy.login() - log in | ||
// FIXME: use cy.request and inject cookie and localStorage.miqToken | ||
Cypress.Commands.add("login", (user = 'admin', password = 'smartvm') => { | ||
cy.visit('/'); | ||
|
||
cy.get('#user_name').type(user); | ||
cy.get('#user_password').type(password); | ||
return cy.get('#login').click(); | ||
}); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For those who might re-reviewing this again, this section was mostly to running get things running via
manageiq-cross_repo-tests
PR I have been using:ManageIQ/manageiq-cross_repo-tests#150
I was trying to write too much bash scripting inside of environment variables, so this was a much easier way to not only debug, but also my idea standardize things a bit using
rake
.That said, this probably won't be needed if we are running things from this repo, and I expect this is probably not a preferred way of doing things by most, so we can remove this once the core changes have been merged. I can always archive this commit somewhere to consider as an option in the future.