Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.editor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.editor
Commits
f2b8075b
Commit
f2b8075b
authored
6 years ago
by
Jaden DIEFENBAUGH
Browse files
Options
Downloads
Patches
Plain Diff
[js] added first part of selenium test for tutorial
parent
3bd52765
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!10
JS & Python Testing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
conda/js/test/selenium_tutorial_test.js
+58
-0
58 additions, 0 deletions
conda/js/test/selenium_tutorial_test.js
with
58 additions
and
0 deletions
conda/js/test/selenium_tutorial_test.js
0 → 100644
+
58
−
0
View file @
f2b8075b
// must have the rest server running with at least the contents of the tutorial prefix
const
{
Builder
,
By
,
Key
,
until
}
=
require
(
'
selenium-webdriver
'
);
const
firefox
=
require
(
'
selenium-webdriver/firefox
'
);
const
options
=
new
firefox
.
Options
();
//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
// navigate to exp list
await
driver
.
findElement
(
By
.
linkText
(
'
experiments
'
)).
click
();
//.sendKeys('webdriver', Key.RETURN);
await
driver
.
wait
(
until
.
elementLocated
(
By
.
css
(
'
input[placeholder="Search experiments..."]
'
),
2000
));
// click the clone button next to test/test/iris/1/iris
let
eLink
=
await
driver
.
findElement
(
By
.
linkText
(
'
test/test/iris/1/iris
'
));
await
eLink
.
findElement
(
By
.
xpath
(
'
../..
'
)).
findElement
(
By
.
css
(
'
button.btn-outline-success
'
)).
click
();
await
driver
.
wait
(
until
.
elementLocated
(
By
.
css
(
'
.modal
'
)),
2000
);
// make new exp
const
eUser
=
await
driver
.
findElement
(
By
.
css
(
'
input[placeholder="Experiment user..."]
'
));
eUser
.
clear
();
eUser
.
sendKeys
(
'
selenium
'
);
const
eName
=
driver
.
findElement
(
By
.
css
(
'
input[placeholder="Experiment name..."]
'
));
eName
.
clear
();
eName
.
sendKeys
(
'
means
'
);
await
driver
.
sleep
(
1000
);
await
driver
.
findElement
(
By
.
css
(
'
.modal button.btn-primary
'
)).
click
();
// go to new exp
await
driver
.
wait
(
until
.
elementLocated
(
By
.
linkText
(
'
selenium/test/iris/1/means
'
)),
2000
);
await
driver
.
sleep
(
1000
);
await
driver
.
findElement
(
By
.
linkText
(
'
selenium/test/iris/1/means
'
)).
click
();
await
driver
.
wait
(
until
.
elementLocated
(
By
.
css
(
'
div.experimentEditor
'
)),
2000
);
// CLEANUP
// go back and delete exp
await
driver
.
findElement
(
By
.
linkText
(
'
experiments
'
)).
click
();
await
driver
.
wait
(
until
.
elementLocated
(
By
.
css
(
'
input[placeholder="Search experiments..."]
'
),
2000
));
eLink
=
await
driver
.
findElement
(
By
.
linkText
(
'
selenium/test/iris/1/means
'
));
await
eLink
.
findElement
(
By
.
xpath
(
'
../..
'
)).
findElement
(
By
.
css
(
'
button.btn-outline-danger
'
)).
click
();
await
driver
.
sleep
(
1000
);
await
driver
.
findElement
(
By
.
css
(
'
.modal button.btn-danger
'
)).
click
();
await
driver
.
sleep
(
1000
);
console
.
log
(
'
selenium tests finished successfully!
'
);
}
catch
(
e
)
{
console
.
log
(
'
selenium tests failed!
'
);
console
.
error
(
e
);
}
finally
{
await
driver
.
quit
();
}
})();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment