4196.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. describe("bug #4196: HTTP basic auth credential retention", function () {
  2. let mainPage
  3. beforeEach(function (client, done) {
  4. mainPage = client
  5. .url("localhost:3230")
  6. .page.main()
  7. client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
  8. .clearValue(".download-url-input")
  9. .setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4196.yaml")
  10. .click("button.download-url-button")
  11. done()
  12. })
  13. afterEach(function (client, done) {
  14. done()
  15. })
  16. it("should display the most recent auth data across modal close/opens", function (client) {
  17. client.waitForElementVisible(".opblock-tag-section", 10000)
  18. .click("button.btn.authorize") // Open modal
  19. .waitForElementVisible("section>input", 5000)
  20. .setValue("section>input", "aaa") // Set user
  21. .waitForElementVisible(`section>input[type="password"]`, 5000)
  22. .setValue(`section>input[type="password"]`, "aaa") // Set password
  23. .click(".auth-btn-wrapper button:nth-child(1)") // Click Authorize
  24. .assert.containsText("div.wrapper:nth-child(4)>code", "aaa")
  25. .click(".auth-btn-wrapper button:nth-child(2)") // Close modal
  26. .pause(50)
  27. .click("button.btn.authorize") // Open modal
  28. .pause(50)
  29. .click(".auth-btn-wrapper button:nth-child(1)") // Logout
  30. .waitForElementVisible("section>input", 5000)
  31. .setValue("section>input", "bbb") // Set user
  32. .waitForElementVisible(`section>input[type="password"]`, 5000)
  33. .setValue(`section>input[type="password"]`, "bbb") // Set password
  34. .click(".auth-btn-wrapper button:nth-child(1)") // Click Authorize
  35. .pause(1000)
  36. .assert.containsText("div.wrapper:nth-child(4)>code", "bbb")
  37. client.end()
  38. })
  39. })