meta: introduce Cypress end-to-end testing (via #4827)
* `test/e2e` -> `test/e2e-selenium` * add Cypress * ESLint fixes * MOAR cypress * `integration` -> `tests` * wire Cypress up to a hot e2e server * linter fixes * don't run in CI
This commit is contained in:
28
test/e2e-selenium/scenarios/on-complete.js
Normal file
28
test/e2e-selenium/scenarios/on-complete.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const expect = require("expect")
|
||||
|
||||
describe("onComplete option", function () {
|
||||
let mainPage
|
||||
beforeEach(function (client, done) {
|
||||
mainPage = client
|
||||
.url("localhost:3230")
|
||||
.page.main()
|
||||
|
||||
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
|
||||
.pause(80)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
it("triggers the page-provided onComplete exactly 1 times", function (client, done) {
|
||||
client.execute(function() {
|
||||
return window.completeCount
|
||||
}, [], (result) => {
|
||||
expect(result.value).toEqual(1)
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user