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 () {
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'))
})
})
--- /dev/null
+import { mkdirSync } from 'fs'
+import { join } from 'path'
+
+const SCREENSHOTS_DIRECTORY = 'screenshots'
+
+function createScreenshotsDirectory () {
+ mkdirSync(SCREENSHOTS_DIRECTORY, { recursive: true })
+}
+
+function getScreenshotPath (filename: string) {
+ return join(SCREENSHOTS_DIRECTORY, filename)
+}
+
+export {
+ createScreenshotsDirectory,
+ getScreenshotPath
+}
import { ChildProcessWithoutNullStreams } from 'child_process'
import { basename } from 'path'
-import { runCommand, runServer } from './server'
import { setValue } from '@wdio/shared-store-service'
+import { createScreenshotsDirectory } from './files'
+import { runCommand, runServer } from './server'
let appInstance: number
let app: ChildProcessWithoutNullStreams
}
async function beforeLocalSession (config: { baseUrl: string }, capabilities: { browserName: string }) {
+ await createScreenshotsDirectory()
+
appInstance = capabilities['browserName'] === 'chrome'
? 1
: 2