Skip to content
Snippets Groups Projects
Unverified Commit 5cc22a26 authored by Varac's avatar Varac
Browse files

Test apps individually with TAIKO_TESTS env var

parent 24d90fc0
No related branches found
No related tags found
No related merge requests found
// Todo:
const { openBrowser, goto, textBox, into, write, click, below, link, press, button, closeBrowser } = require('taiko')
const { openBrowser, goto, textBox, into, write, click, below, link, press, button, closeBrowser, screencast } = require('taiko')
const assert = require('assert').strict;
(async () => {
try {
const taiko_tests = process.env.TAIKO_TESTS || "all"
const username = process.env.SSO_USERNAME
const pw = process.env.SSO_USER_PW
const domain = process.env.DOMAIN
......@@ -15,6 +12,8 @@ const assert = require('assert').strict;
console.log('• Login to admin panel')
await openBrowser()
await screencast.startScreencast('output.gif')
await goto(adminpanel_url)
await click('Login')
await click('Login with OAS')
......@@ -23,69 +22,84 @@ const assert = require('assert').strict;
await click('Remember me')
await click('Sign in')
// console.log('• Nextcloud and Onlyoffice')
// await click(link(below('nextcloud')))
// await click('Log in with OpenAppStack')
// await click('Continue with demo')
// // Close potential nextcloud modal
// await press('Escape')
// // Open document
// await click(link('Documents'))
// await click(link('Welcome to Nextcloud Hub.docx'))
// // Logout
// click(image())
// click('Log out')
// Navigate to rocketchat
// Breaks because of 2fa challenge which is not recieved
// by email
// TODO: Create issue
// await click(link(below('rocketchat')));
// await click('Login via OpenAppStack');
// await click('Continue with demo');
// console.log('• Wordpress')
// await goto(adminpanel_url)
// await click(link(below('wordpress')))
// await click('Log in')
// await click('Login with OpenID Connect')
// await click('Continue with demo')
console.log('• Grafana')
await goto(adminpanel_url)
await click(link(below('grafana')))
await click('Sign in with OpenAppStack')
await click('Continue with demo')
// Node exporter dashboard
// Couldn't select "Manage dashboards" from the sidebar menu easily,
// so we just go there
// await goto(grafana_url + '/dashboards')
// click('Nodes')
// Explore Loki log messages
await goto(grafana_url + '/explore')
// only visible in bigger screens
//await click('Prometheus')
await click(image(toRightOf('Explore')))
await click('Loki')
await click('Log browser')
await click('app')
await click('cert-manager')
await click('grafana')
await click('Show logs')
// write('{job=~".*"} |~ "error|fail|exception|fatal"')
//click('Run Query')
// Nextcloud
if (taiko_tests.includes('nextcloud') || taiko_tests == 'all') {
console.log('• Nextcloud and Onlyoffice')
await click(link(below('nextcloud')))
await click('Log in with OpenAppStack')
await click('Continue with ' + username)
// Close potential nextcloud modal
await press('Escape')
// Open document
await click(link('Documents'))
await click(link('Welcome to Nextcloud Hub.docx'))
// Logout
click(image())
click('Log out')
}
// Rocketchat
if (taiko_tests.includes('rocketchat') || taiko_tests == 'all') {
// Navigate to rocketchat
// Breaks because of 2fa challenge which is not recieved
// by email
// TODO: Create issue
// await click(link(below('rocketchat')));
// await click('Login via OpenAppStack');
// await click('Continue with ' + username)
}
// Wordpress
if (taiko_tests.includes('wordpress') || taiko_tests == 'all') {
// console.log('• Wordpress')
// await goto(adminpanel_url)
// await click(link(below('wordpress')))
// await click('Log in')
// await click('Login with OpenID Connect')
// await click('Continue with ' + username)
}
if (taiko_tests.includes('wordpress') || taiko_tests == 'all') {
console.log('• Grafana')
await goto(adminpanel_url)
await click(link(below('grafana')))
await click('Sign in with OpenAppStack')
await click('Continue with ' + username)
}
// Grafana
if (taiko_tests.includes('grafana') || taiko_tests == 'all') {
// Node exporter dashboard
// Couldn't select "Manage dashboards" from the sidebar menu easily,
// so we just go there
await goto(grafana_url + '/dashboards')
click('Nodes')
// Explore Loki log messages
await goto(grafana_url + '/explore')
await click(image(toRightOf('Explore')))
await click('Loki')
await click('Log browser')
await click('app')
await click('cert-manager')
await click('grafana')
await click('Show logs')
// write('{job=~".*"} |~ "error|fail|exception|fatal"')
//click('Run Query')
}
// Wait a bit before closing browser
await waitFor(20000)
} catch (error) {
await screenshot()
await screencast.stopScreencast();
console.error(error)
} finally {
await screencast.stopScreencast();
await closeBrowser()
}
})()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment