import { AdminRegistrationPage } from '../po/admin-registration.po'
import { LoginPage } from '../po/login.po'
import { SignupPage } from '../po/signup.po'
-import { browserSleep, getVerificationLink, go, findEmailTo, isMobileDevice, MockSMTPServer, waitServerUp } from '../utils'
+import {
+ browserSleep,
+ findEmailTo,
+ getScreenshotPath,
+ getVerificationLink,
+ go,
+ isMobileDevice,
+ MockSMTPServer,
+ waitServerUp
+} from '../utils'
function checkEndMessage (options: {
message: string
afterEmailVerification: false
})
- await browser.saveScreenshot('./screenshots/direct-without-email.png')
+ await browser.saveScreenshot(getScreenshotPath('direct-without-email.png'))
await loginPage.logout()
})
afterEmailVerification: false
})
- await browser.saveScreenshot('./screenshots/request-without-email.png')
+ await browser.saveScreenshot(getScreenshotPath('request-without-email.png'))
})
it('Should display a message when trying to login with this account', async function () {
let emailPort: number
before(async () => {
+ const key = browser.options.baseUrl + '-emailPort'
// FIXME: typings are wrong, get returns a promise
- emailPort = await browser.sharedStore.get('emailPort') as unknown as number
+ // FIXME: use * because the key is not properly escaped by the shared store when using get(key)
+ emailPort = (await (browser.sharedStore.get('*') as unknown as Promise<number>))[key]
- MockSMTPServer.Instance.collectEmails(emailPort, emails)
+ await MockSMTPServer.Instance.collectEmails(emailPort, emails)
})
describe('Direct registration', function () {
afterEmailVerification: false
})
- await browser.saveScreenshot('./screenshots/direct-with-email.png')
+ await browser.saveScreenshot(getScreenshotPath('direct-with-email.png'))
})
it('Should validate the email', async function () {
afterEmailVerification: true
})
- await browser.saveScreenshot('./screenshots/direct-after-email.png')
+ await browser.saveScreenshot(getScreenshotPath('direct-after-email.png'))
})
})
afterEmailVerification: false
})
- await browser.saveScreenshot('./screenshots/request-with-email.png')
+ await browser.saveScreenshot(getScreenshotPath('request-with-email.png'))
})
it('Should display a message when trying to login with this account', async function () {
afterEmailVerification: true
})
- await browser.saveScreenshot('./screenshots/request-after-email.png')
+ await browser.saveScreenshot(getScreenshotPath('request-after-email.png'))
})
})
- before(() => {
+ after(() => {
MockSMTPServer.Instance.kill()
})
})