api-client/tests/e2e/integration/feature.url-queries.spec.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

describe("Authentication", () => {
2020-03-12 17:19:43 +00:00
it(`Change default Auth username and password with URL`, () => {
2020-01-01 08:21:28 +00:00
cy.visit(`?&auth=Basic Auth&httpUser=foo&httpPassword=bar`, { retryOnStatusCodeFailure: true })
.get('input[name="http_basic_user"]', { timeout: 500 })
.invoke("val")
2020-06-19 06:56:04 +00:00
.then((user) => {
expect(user === "foo").to.equal(true)
})
2019-10-04 00:47:41 +00:00
.get('input[name="http_basic_passwd"]')
.invoke("val")
2020-06-19 06:56:04 +00:00
.then((pass) => {
expect(pass === "bar").to.equal(true)
})
2019-10-04 00:47:41 +00:00
})
2020-06-23 18:28:48 +00:00
// it("Enable username and password in URL with toggler", () => {
// cy.visit("/", { retryOnStatusCodeFailure: true })
// .get("#auth")
// .select("Basic Auth")
// .get('input[name="http_basic_user"]', { timeout: 500 })
// .type("foo")
// .get('input[name="http_basic_passwd"]', { timeout: 500 })
// .type("bar")
// .url()
// .should("not.contain", "foo")
// .should("not.contain", "bar")
// .get(".toggle")
// .click()
// .url()
// .should("contain", "foo")
// .should("contain", "bar")
// })
2019-10-04 00:47:41 +00:00
})