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
d4294829
Unverified
Commit
d4294829
authored
Aug 13, 2021
by
Bryce Taylor
Committed by
GitHub
Aug 13, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5743 from BryceLTaylor/test-studio-rate-limit
Add studio rate limit integration test
parents
b215b952
00154fdd
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 @
d4294829
...
...
@@ -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