Created
March 29, 2021 00:51
-
-
Save javajon/bd058768c3fea01ac24c47a4500e77e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
openBrowser, | |
goto, | |
text, | |
click, | |
closeBrowser | |
} = require('taiko'); | |
const headless = process.env.headless_chrome.toLowerCase() === 'true'; | |
beforeSuite(async () => { | |
await openBrowser({headless: headless}) | |
}); | |
afterSuite(async () => { | |
await closeBrowser(); | |
}); | |
step("Start javajon scenario <scenario>", async function (scenario) { | |
try { | |
await goto("https://katacoda.com/javajon/courses/" + scenario); | |
} catch (error) { | |
console.log(error); | |
} | |
}); | |
step("Check intro", async function () { | |
try { | |
await text("Difficulty:").exists(); | |
await text("Introduction").exists(); | |
await text('10 minutes').exists(); | |
await text('Jonathan Johnson').exists(); | |
await click('START SCENARIO'); | |
} catch (error) { | |
console.log(error); | |
} | |
}); | |
step("Check step 1", async function () { | |
try { | |
await text("helm version --short").exists(); | |
await click(text("helm version --short")); | |
await text("v3.1.2+").exists(); | |
await click(text("kubectl version --short")); | |
await text("controlplane Ready").exists(); | |
await text("node01 Ready").exists(); | |
await text("Server Version: v1.18.0").exists(); | |
await click(text("token.sh")); | |
await text("Copy and paste this token for dashboard access").exists(); | |
await click("CONTINUE"); | |
} catch (error) { | |
console.log(error); | |
} | |
}); | |
step("Check step 2", async function () { | |
try { | |
await click(text("kubectl version")); | |
await text("/Server.*Info.*v1.18.0/").exists(); | |
await click("kubectl run nginx-one --image=nginx"); | |
} catch (error) { | |
console.log(error); | |
} | |
}); | |
function row(command, result) { | |
console.log(command, result) | |
}; | |
step("Show table <table>", async function(table) { | |
table.rows.forEach(function (row) { | |
row(row.cells[0], row.cells[1]) | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment