mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-13 01:25:45 +00:00
* More screenshots link * bugfix: wip * cicd: Test flakey tests * cicd: more tests * cicd: more tests * cicd: Try a 10s timeout * cicd: Better debugging of process start / stop * cicd: Better debugging of process start / stop * cicd: Possibly unflaky tests
28 lines
832 B
JavaScript
28 lines
832 B
JavaScript
import { By } from 'selenium-webdriver'
|
|
import fs from 'fs'
|
|
import { Condition } from 'selenium-webdriver'
|
|
|
|
export async function getActionButtons (webdriver) {
|
|
return await webdriver.findElement(By.id('contentActions')).findElements(By.tagName('button'))
|
|
}
|
|
|
|
export function takeScreenshot (webdriver) {
|
|
return webdriver.takeScreenshot().then((img) => {
|
|
fs.writeFileSync('out.png', img, 'base64')
|
|
})
|
|
}
|
|
|
|
export async function getRootAndWait() {
|
|
await webdriver.get(runner.baseUrl())
|
|
await webdriver.wait(new Condition('wait for initial-marshal-complete', async function() {
|
|
const body = await webdriver.findElement(By.tagName('body'))
|
|
const attr = await body.getAttribute('initial-marshal-complete')
|
|
|
|
if (attr == 'true') {
|
|
return true
|
|
} else {
|
|
return false
|
|
}
|
|
}))
|
|
}
|