-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend js unit tests #676 #36
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,26 @@ | |||
Pull Request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can the use .md extension in the Readme (e.g. Readme.md) so we can write in markdown the documentation.
driver.find_element_by_id("password").send_keys(credentials['password']) | ||
driver.find_element_by_id("_submit").click() | ||
|
||
assert driver.find_element_by_id("private-sketches-counter").text=="0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space between the comparison operator.
Also it maybe be better to just read the counters when you first visit the home page in order to get their initial state.
After creating / deleting sketches you can then check the counters values in order to test their behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
actions.double_click(changeButton) | ||
actions.perform() | ||
self.get_element(By.ID, "logo_small").click() | ||
assert driver.find_element_by_id("public-sketches-counter").text=="2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space.
Please be more descriptive in your commit messages. |
self.get_element(By.ID, "save") | ||
driver.find_element_by_id("logo_small").click() | ||
#Check that the sketch was created | ||
assert driver.find_element_by_id("public-sketches-counter").text=="1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space.
Checks that counters: Public sketches (blue) and Private sketches (purple) have the correct value (number of sketches of each category). Checks that the counter for private projects also appears at the Badges section and has the correct value. Checks that the number of private projects available is updated each time that you make a change (e.g from private to public and vice versa). Checks that the counter for available private sketches also appears at the upload sketch modal (ino, zip, multiple zip) and at the create sketch modal. Checks that All, Public and Private filters work.
00a8a1c
to
1a058b5
Compare
Check the description character counter is always in sync with the length of the short description. Check that when you enter a short description longer than 140 chars the character counter becomes red.
Tests that when a project is cloned in user's homepage message "Cloned from Sketch sketch_name by username" appears under the cloned project.
Test that when you create a sketch with short description, short description appears under sketch's title. Test that when a sketch is created, created message appears next to its title.
Check that share modal opens and you can click Embed tab. Check that you can swith back to Share tab inside share modal.
Tests that when a sketch is cloned, sketch opens in editor. Tests that in user's home page message Cloned from Sketch sketch_name by username appears under the cloned project.
Function now waits until x icon is clickable.
Homepage test cases:
upload sketch
modal (ino, zip, multiple zip) and at thecreate
andedit
sketch modal.create sketch
modal and try to create a new project without providing a name. TheCreate
button should be disabled.Untitled Sketch CURRENT_DATE
.All
,Public
andPrivate
buttons work, clicking on each of them and verifying that the correct number of sketches is viewed each time.Cloned from Sketch sketch_name by username
appears under the cloned project.Inside sketch block test cases:
Create
button and go back to homepage. Sketch should sayCreated
instead ofModified
.Modified
instead ofCreated
.Share
button. Click onShare
button and check that it opens the share modal (titled "Share your Sketch").Clone
button and check that the sketch is cloned and opens in editor.Delete
button and check that the project is correctly deleted (it deletes the sketch and filelist is updated). Check that when the sketch is deleted the modal stays open showing the result of the deletion.Editor test cases:
private
.public
.Clone
button. You should get redirected to a new editor, check the name ("copy").