Skip to content
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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Conversation

penelopez
Copy link
Contributor

@penelopez penelopez commented Jun 23, 2016

Homepage test cases:
  • Login and visit the new home page.
  • Create 2 public sketches
  • Create 2 private sketches
  • Check that when the page loads, the loading screen appears and message "Loading the Sketches, please wait" is displayed.
  • Check that the counters:
    • Public sketches (blue) have the correct value.
    • Private sketches (purple) have the correct value.
  • Check that the counter for private projects also appears at the Badges section and has the correct value.
  • Check that if your account has private projects (e.g. 2) and all yor projects are public, counter for available private sketches should be 0/number of total private sketches(e.g. 0/2) and the link to the private sketches should be Add more.
  • Check 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).
    • Change the private sketch to public
    • Change the public to private
  • Check that the counter for available private sketches also appears at the upload sketch modal (ino, zip, multiple zip) and at the create and edit sketch modal.
  • Open the create sketch modal and try to create a new project without providing a name. The Create button should be disabled.
  • Check that sketch name is auto-generated as: Untitled Sketch CURRENT_DATE.
  • Check that when you enter a short description longer than the supported, the extra text is highlighted with a red mark and sketch counter becomes red.
  • Check the description Character count is always in sync with the length of the short description.
  • Check that when you create the sketch you are redirected into the editor.
  • Check that All, Public and Private buttons work, clicking on each of them and verifying that the correct number of sketches is viewed each time.
  • Clone one of demo_user's sketches. Go to your home page and see that message Cloned from Sketch sketch_name by username appears under the cloned project.
Inside sketch block test cases:
  • Check that when you click on its name, sketch opens in editor.
  • Check that when a sketch has a short description, it appears at the section below the name, else the section does not appear at all.
  • Check that the file list of the sketch is at the bottom of the sketch block.
  • Create a sketch using the Create button and go back to homepage. Sketch should say Created instead of Modified.
  • Go back to the sketch previously created and do some changes. Save it and go back to homepage. Sketch should say Modified instead of Created.
  • Check the Share button. Click on Share button and check that it opens the share modal (titled "Share your Sketch").
  • Check the clone sketch function. Click on Clone button and check that the sketch is cloned and opens in editor.
  • Check the delete sketch fuction. Click on 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:
  • Open a sketch in editor and double click the earth icon on the left of its title to make it private .
  • Go to the same sketch and double click the earth icon on the left of its title to make it public .
  • Go to a sketch in editor and change the short description. After the short description is set, make sure it's visible next to the editor (below the file-list).
  • Rename the sketch from the editor and verify the name of the sketch is successfully updated.
  • Go to a sketch in editor and add a file. Make sure the file-list length is increased by one and that the name of the new element is the filename you provided.
  • Go to a sketch in editor and delete a file. Make sure the file no longer exists in the file-list.
  • Go to a sketch in editor and rename a file. Make sure the new filename exists in the file-list.
  • Go to a sketch in editor and click the Clone button. You should get redirected to a new editor, check the name ("copy").

@@ -0,0 +1,26 @@
Pull Request:
Copy link
Contributor

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"
Copy link
Contributor

@freskoulix freskoulix Jul 4, 2016

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.

Copy link
Contributor Author

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space.

@freskoulix
Copy link
Contributor

freskoulix commented Jul 4, 2016

Please be more descriptive in your commit messages.
They should contain a short description of the change so someone can follow the changes when looking at the history by the description without having to look at each commit's code.

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space.

konstantina added 8 commits July 29, 2016 16:03
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.
@Konstantinacc Konstantinacc force-pushed the frontend_js_unit_tests branch from 00a8a1c to 1a058b5 Compare August 2, 2016 07:28
konstantina added 15 commits August 2, 2016 17:14
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants