2020-02-25 02:06:23 +00:00
|
|
|
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 })
|
2020-02-01 21:36:51 +00:00
|
|
|
.get('input[name="http_basic_user"]', { timeout: 500 })
|
2020-02-25 02:06:23 +00:00
|
|
|
.invoke("val")
|
2020-06-19 06:56:04 +00:00
|
|
|
.then((user) => {
|
2020-02-25 02:06:23 +00:00
|
|
|
expect(user === "foo").to.equal(true)
|
2020-02-01 21:36:51 +00:00
|
|
|
})
|
2019-10-04 00:47:41 +00:00
|
|
|
|
2020-02-01 21:36:51 +00:00
|
|
|
.get('input[name="http_basic_passwd"]')
|
2020-02-25 02:06:23 +00:00
|
|
|
.invoke("val")
|
2020-06-19 06:56:04 +00:00
|
|
|
.then((pass) => {
|
2020-02-25 02:06:23 +00:00
|
|
|
expect(pass === "bar").to.equal(true)
|
2020-02-01 21:36:51 +00:00
|
|
|
})
|
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
|
|
|
})
|