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
00154fdd
Commit
00154fdd
authored
Jul 19, 2021
by
BryceLTaylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add studio rate limit integration test
parent
d5d3107d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
7 deletions
+37
-7
test/integration/my-stuff.test.js
test/integration/my-stuff.test.js
+37
-7
No files found.
test/integration/my-stuff.test.js
View file @
00154fdd
...
...
@@ -89,23 +89,53 @@ describe('www-integration my_stuff', () => {
await
expect
(
dropDownVisible
).
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"]
'
);
let
gfVisible
=
await
gf
.
isDisplayed
();
await
expect
(
gfVisible
).
toBe
(
true
);
});
test
(
'
+ New Studio button should take you to the studio page
'
,
async
()
=>
{
await
driver
.
get
(
rateLimitCheck
);
await
driver
.
get
(
myStuffURL
);
await
clickXpath
(
'
//form[@id="new_studio"]/button[@type="submit"]
'
);
await
driver
.
sleep
(
500
);
// my stuff also has an element with the id tabs
let
tabs
=
await
findByXpath
(
'
//div[@class="studio-tabs"]
'
);
let
tabsVisible
=
await
tabs
.
isDisplayed
();
expect
(
tabsVisible
).
toBe
(
true
);
});
test
(
'
+ New Project button should open the editor
'
,
async
()
=>
{
test
(
'
New studio rate limited to five
'
,
async
()
=>
{
await
driver
.
get
(
rateLimitCheck
);
// 1st studio
await
driver
.
get
(
myStuffURL
);
await
clickText
(
'
+ New Project
'
);
let
gf
=
await
findByXpath
(
'
//img[@class="green-flag_green-flag_1kiAo"]
'
);
let
gfVisible
=
await
gf
.
isDisplayed
();
await
expect
(
gfVisible
).
toBe
(
true
);
await
clickXpath
(
'
//form[@id="new_studio"]/button[@type="submit"]
'
);
await
findByXpath
(
'
//div[@class="studio-tabs"]
'
);
// 2nd studio
await
driver
.
get
(
myStuffURL
);
await
clickXpath
(
'
//form[@id="new_studio"]/button[@type="submit"]
'
);
await
findByXpath
(
'
//div[@class="studio-tabs"]
'
);
// 3rd studio
await
driver
.
get
(
myStuffURL
);
await
clickXpath
(
'
//form[@id="new_studio"]/button[@type="submit"]
'
);
await
findByXpath
(
'
//div[@class="studio-tabs"]
'
);
// 4th studio
await
driver
.
get
(
myStuffURL
);
await
clickXpath
(
'
//form[@id="new_studio"]/button[@type="submit"]
'
);
await
findByXpath
(
'
//div[@class="studio-tabs"]
'
);
// 5th studio
await
driver
.
get
(
myStuffURL
);
await
clickXpath
(
'
//form[@id="new_studio"]/button[@type="submit"]
'
);
await
findByXpath
(
'
//div[@class="studio-tabs"]
'
);
// 6th studio should fail
await
driver
.
get
(
myStuffURL
);
await
clickXpath
(
'
//form[@id="new_studio"]/button[@type="submit"]
'
);
let
alertMessage
=
await
findByXpath
(
'
//div[contains(@class, "alert-error")]
'
);
let
errVisible
=
await
alertMessage
.
isDisplayed
();
await
expect
(
errVisible
).
toBe
(
true
);
await
driver
.
get
(
rateLimitCheck
);
});
});
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