Commit 4f3eab03 authored by Jaden DIEFENBAUGH's avatar Jaden DIEFENBAUGH
Browse files

[js] finish first part of E2E testing from the tutorial (the means exp), #119

parent f2b8075b
......@@ -3,14 +3,16 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
const firefox = require('selenium-webdriver/firefox');
const options = new firefox.Options();
//options.addArguments('-headless');
options.addArguments('-headless');
(async function example() {
let driver = await new Builder().forBrowser('firefox').setFirefoxOptions(options).build();
try {
await driver.get('http://localhost:9101/');
// create the means experiment
/**************************************************************
* MEANS EXP
*/
// navigate to exp list
await driver.findElement(By.linkText('experiments')).click();
//.sendKeys('webdriver', Key.RETURN);
......@@ -37,7 +39,42 @@ const options = new firefox.Options();
await driver.findElement(By.linkText('selenium/test/iris/1/means')).click();
await driver.wait(until.elementLocated(By.css('div.experimentEditor')), 2000);
// CLEANUP
// click on training_alg block
await driver.findElement(By.css('rect#block_training_alg')).click();
await driver.wait(until.elementLocated(By.css('div.block_training_alg')), 2000);
// set the algorithm to the new one
await driver.findElement(By.css('select.custom-select')).click();
await driver.findElement(By.css('select.custom-select option[value="test/means_training/1"]')).click();
// do same for testing_alg block
await driver.findElement(By.css('rect#block_testing_alg')).click();
await driver.wait(until.elementLocated(By.css('div.block_testing_alg')), 2000);
await driver.findElement(By.css('select.custom-select')).click();
await driver.findElement(By.css('select.custom-select option[value="test/means_testing/1"]')).click();
// make sure the exp is still valid
await driver.wait(until.elementLocated(By.css('.badge-success')), 2000);
// save exp
await driver.findElement(By.css('div.experimentEditor > div.d-flex > button.btn-outline-secondary')).click();
await driver.sleep(1000);
/**************************************************************
* ADVANCED IRIS TOOLCHAIN
*/
/**************************************************************
* ADVANCED IRIS PREPROCESSOR ALGORITHM
*/
/**************************************************************
* ADVANCED IRIS EXPERIMENT
*/
/**************************************************************
* CLEANUP
*/
// go back and delete exp
await driver.findElement(By.linkText('experiments')).click();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment