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
d51c984b
Commit
d51c984b
authored
6 years ago
by
Paul Kaplan
Browse files
Options
Downloads
Patches
Plain Diff
Add integration test for uploading a file and seeing the prompt
parent
361a9d73
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/fixtures/project1.sb3
+0
-0
0 additions, 0 deletions
test/fixtures/project1.sb3
test/integration/menu-bar.test.js
+33
-1
33 additions, 1 deletion
test/integration/menu-bar.test.js
with
33 additions
and
1 deletion
test/fixtures/project1.sb3
0 → 100644
+
0
−
0
View file @
d51c984b
File added
This diff is collapsed.
Click to expand it.
test/integration/menu-bar.test.js
+
33
−
1
View file @
d51c984b
...
...
@@ -4,9 +4,13 @@ import SeleniumHelper from '../helpers/selenium-helper';
const
{
clickText
,
clickXpath
,
findByText
,
findByXpath
,
getDriver
,
loadUri
loadUri
,
rightClickText
,
scope
,
waitUntilGone
}
=
new
SeleniumHelper
();
const
uri
=
path
.
resolve
(
__dirname
,
'
../../build/index.html
'
);
...
...
@@ -74,4 +78,32 @@ describe('Menu bar settings', () => {
await
clickText
(
'
Costumes
'
);
// just to blur the input
await
clickXpath
(
'
//input[@value="Scratch Project - Personalized"]
'
);
});
test
(
'
User is not warned before uploading project file over a fresh project
'
,
async
()
=>
{
await
loadUri
(
uri
);
await
clickXpath
(
'
//button[@title="Try It"]
'
);
await
clickText
(
'
File
'
);
const
input
=
await
findByXpath
(
'
//input[@accept=".sb,.sb2,.sb3"]
'
);
await
input
.
sendKeys
(
path
.
resolve
(
__dirname
,
'
../fixtures/project1.sb3
'
));
await
waitUntilGone
(
findByText
(
'
Loading
'
));
// No replace alert since no changes were made
await
findByText
(
'
project1-sprite
'
);
});
test
(
'
User is warned before uploading project file over an edited project
'
,
async
()
=>
{
await
loadUri
(
uri
);
await
clickXpath
(
'
//button[@title="Try It"]
'
);
// Change the project by deleting a sprite
await
rightClickText
(
'
Sprite1
'
,
scope
.
spriteTile
);
await
clickText
(
'
delete
'
,
scope
.
spriteTile
);
await
clickText
(
'
File
'
);
const
input
=
await
findByXpath
(
'
//input[@accept=".sb,.sb2,.sb3"]
'
);
await
input
.
sendKeys
(
path
.
resolve
(
__dirname
,
'
../fixtures/project1.sb3
'
));
await
driver
.
switchTo
().
alert
()
.
accept
();
await
waitUntilGone
(
findByText
(
'
Loading
'
));
await
findByText
(
'
project1-sprite
'
);
});
});
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