Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
David Goessmann
logging-scratch-gui
Commits
f244da77
Commit
f244da77
authored
5 years ago
by
Ben Wheeler
Browse files
Options
Downloads
Patches
Plain Diff
added project-state integration test for new title
parent
21d6ce11
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/helpers/selenium-helper.js
+2
-0
2 additions, 0 deletions
test/helpers/selenium-helper.js
test/integration/project-state.test.js
+45
-0
45 additions, 0 deletions
test/integration/project-state.test.js
with
47 additions
and
0 deletions
test/helpers/selenium-helper.js
+
2
−
0
View file @
f244da77
...
...
@@ -28,6 +28,8 @@ class SeleniumHelper {
'
loadUri
'
,
'
rightClickText
'
]);
this
.
Key
=
webdriver
.
Key
;
// map Key constants, for sending special keys
}
elementIsVisible
(
element
,
timeoutMessage
=
'
elementIsVisible timed out
'
)
{
...
...
This diff is collapsed.
Click to expand it.
test/integration/project-state.test.js
0 → 100644
+
45
−
0
View file @
f244da77
import
path
from
'
path
'
;
import
SeleniumHelper
from
'
../helpers/selenium-helper
'
;
const
{
clickText
,
clickXpath
,
findByXpath
,
getDriver
,
Key
,
loadUri
}
=
new
SeleniumHelper
();
const
uri
=
path
.
resolve
(
__dirname
,
'
../../build/index.html
'
);
let
driver
;
describe
(
'
Project state
'
,
()
=>
{
beforeAll
(()
=>
{
driver
=
getDriver
();
});
afterAll
(
async
()
=>
{
await
driver
.
quit
();
});
test
(
'
File->New resets project title
'
,
async
()
=>
{
const
defaultProjectTitle
=
'
Scratch Project
'
;
await
loadUri
(
uri
);
const
inputEl
=
await
findByXpath
(
`//input[@value="
${
defaultProjectTitle
}
"]`
);
for
(
let
i
=
0
;
i
<
defaultProjectTitle
.
length
;
i
++
)
{
inputEl
.
sendKeys
(
Key
.
BACK_SPACE
);
}
inputEl
.
sendKeys
(
'
Changed title of project
'
);
await
clickText
(
'
Costumes
'
);
// just to blur the input
// verify that project title has changed
await
clickXpath
(
'
//input[@value="Changed title of project"]
'
);
await
clickXpath
(
'
//div[contains(@class, "menu-bar_menu-bar-item") and
'
+
'
contains(@class, "menu-bar_hoverable")][span[text()="File"]]
'
);
await
clickXpath
(
'
//li[span[text()="New"]]
'
);
// project title should be default again
await
clickXpath
(
`//input[@value="
${
defaultProjectTitle
}
"]`
);
});
});
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