Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
bec30017
Commit
bec30017
authored
Aug 27, 2020
by
BryceLTaylor
Committed by
Ben Wheeler
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update My-Stuff tests to correctly use ‘expect’ and remove sleeps
parent
629f3dda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
16 deletions
+29
-16
test/integration/my-stuff.test.js
test/integration/my-stuff.test.js
+29
-16
No files found.
test/integration/my-stuff.test.js
View file @
bec30017
...
...
@@ -41,29 +41,41 @@ describe('www-integration my_stuff', () => {
test
(
'
verify My Stuff structure (tabs, title)
'
,
async
()
=>
{
await
driver
.
get
(
myStuffURL
);
await
findByXpath
(
'
//div[@class="box-head"]/h2
'
);
await
findByXpath
(
'
//li[@data-tab="projects"]/a
'
);
await
findByXpath
(
'
//li[@data-tab="shared"]/a
'
);
await
findByXpath
(
'
//li[@data-tab="unshared"]/a
'
);
await
findByXpath
(
'
//li[@data-tab="galleries"]/a
'
);
await
findByXpath
(
'
//li[@data-tab="trash"]/a
'
);
let
header
=
await
findByXpath
(
'
//div[@class="box-head"]/h2
'
);
let
headerVisible
=
await
header
.
isDisplayed
();
await
expect
(
headerVisible
).
toBe
(
true
);
let
allTab
=
await
findByXpath
(
'
//li[@data-tab="projects"]/a
'
);
let
allTabVisible
=
await
allTab
.
isDisplayed
();
await
expect
(
allTabVisible
).
toBe
(
true
);
let
sharedTab
=
await
findByXpath
(
'
//li[@data-tab="shared"]/a
'
);
let
sharedTabVisible
=
await
sharedTab
.
isDisplayed
();
await
expect
(
sharedTabVisible
).
toBe
(
true
);
let
unsharedTab
=
await
findByXpath
(
'
//li[@data-tab="unshared"]/a
'
);
let
unsharedTabVisible
=
await
unsharedTab
.
isDisplayed
();
await
expect
(
unsharedTabVisible
).
toBe
(
true
);
let
studios
=
await
findByXpath
(
'
//li[@data-tab="galleries"]/a
'
);
let
studiosVisible
=
await
studios
.
isDisplayed
();
await
expect
(
studiosVisible
).
toBe
(
true
);
let
trash
=
await
findByXpath
(
'
//li[@data-tab="trash"]/a
'
);
let
trashVisible
=
await
trash
.
isDisplayed
();
await
expect
(
trashVisible
).
toBe
(
true
);
});
test
(
'
clicking a project title should take you to the project page
'
,
async
()
=>
{
test
(
'
clicking a project title should take you to the project page
'
,
async
()
=>
{
await
driver
.
get
(
myStuffURL
);
await
clickXpath
(
'
//span[@class="media-info-item title"]
'
);
await
driver
.
sleep
(
6000
);
let
gui
=
await
findByXpath
(
'
//div[@class="guiPlayer"]
'
);
await
expect
(
gui
.
isDisplayed
()
);
await
driver
.
sleep
(
1500
);
let
guiVisible
=
await
gui
.
isDisplayed
(
);
await
expect
(
guiVisible
).
toBe
(
true
);
});
test
(
'
clicking "see inside" should take you to the editor
'
,
async
()
=>
{
await
driver
.
get
(
myStuffURL
);
await
clickXpath
(
'
//a[@data-control="edit"]
'
);
let
gf
=
await
findByXpath
(
'
//img[@class="green-flag_green-flag_1kiAo"]
'
);
await
expect
(
gf
.
isDisplayed
()
);
await
driver
.
sleep
(
1000
);
let
gfVisible
=
await
gf
.
isDisplayed
(
);
await
expect
(
gfVisible
).
toBe
(
true
);
});
test
(
'
Add To button should bring up a list of studios
'
,
async
()
=>
{
...
...
@@ -71,8 +83,8 @@ describe('www-integration my_stuff', () => {
await
clickXpath
(
'
//div[@id="sidebar"]/ul/li[@data-tab="shared"]
'
);
await
clickXpath
(
'
//div[@data-control="add-to"]
'
);
let
dropDown
=
await
findByXpath
(
'
//div[@class="dropdown-menu"]/ul/li
'
);
await
expect
(
dropDown
.
isDisplayed
()
);
await
driver
.
sleep
(
1000
);
let
dropDownVisible
=
await
dropDown
.
isDisplayed
(
);
await
expect
(
dropDownVisible
).
toBe
(
true
);
});
test
(
'
+ New Studio button should take you to the studio page
'
,
async
()
=>
{
...
...
@@ -81,15 +93,16 @@ describe('www-integration my_stuff', () => {
await
driver
.
sleep
(
500
);
// my stuff also has an element with the id tabs
let
tabs
=
await
findByXpath
(
'
//ul[@id="tabs" and @class="tabs-index box-h-tabs h-tabs"]
'
);
expect
(
tabs
.
isDisplayed
()
);
await
driver
.
sleep
(
1000
);
let
tabsVisible
=
await
tabs
.
isDisplayed
(
);
expect
(
tabsVisible
).
toBe
(
true
);
});
test
(
'
+ New Project button should open the editor
'
,
async
()
=>
{
await
driver
.
get
(
myStuffURL
);
await
clickText
(
'
+ New Project
'
);
let
gf
=
await
findByXpath
(
'
//img[@class="green-flag_green-flag_1kiAo"]
'
);
await
expect
(
gf
.
isDisplayed
());
let
gfVisible
=
await
gf
.
isDisplayed
();
await
expect
(
gfVisible
).
toBe
(
true
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment