|
|
@@ -8,11 +8,15 @@ import {
|
|
|
describe('config: localAuth', function () {
|
|
|
this.timeout(30000) // Increase timeout to 30 seconds
|
|
|
|
|
|
+ let originalWindowRect
|
|
|
+
|
|
|
before(async function () {
|
|
|
+ originalWindowRect = await webdriver.manage().window().getRect()
|
|
|
await runner.start('localAuth')
|
|
|
})
|
|
|
|
|
|
after(async () => {
|
|
|
+ await webdriver.manage().window().setRect(originalWindowRect)
|
|
|
await runner.stop()
|
|
|
})
|
|
|
|
|
|
@@ -99,4 +103,24 @@ describe('config: localAuth', function () {
|
|
|
console.log('Login form not found - skipping login test')
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ it('Header login link stays usable on narrow screens', async function () {
|
|
|
+ await webdriver.manage().window().setRect({ width: 400, height: 800 })
|
|
|
+ await webdriver.manage().deleteAllCookies()
|
|
|
+ await webdriver.get(runner.baseUrl())
|
|
|
+
|
|
|
+ const loginLink = await webdriver.wait(until.elementLocated(By.css('header .login-link')), 10000)
|
|
|
+ await webdriver.wait(until.elementIsVisible(loginLink), 5000)
|
|
|
+
|
|
|
+ expect(await loginLink.getAttribute('aria-label')).to.equal('Login')
|
|
|
+
|
|
|
+ const loginIcon = await loginLink.findElement(By.css('svg'))
|
|
|
+ expect(await loginIcon.isDisplayed()).to.equal(true)
|
|
|
+
|
|
|
+ const linkSize = await loginLink.getRect()
|
|
|
+ expect(linkSize.width).to.be.greaterThan(20)
|
|
|
+
|
|
|
+ await loginLink.click()
|
|
|
+ await webdriver.wait(until.urlContains('/login'), 5000)
|
|
|
+ })
|
|
|
})
|