QA SoftVision Team/Mobile/Writing tests: Difference between revisions

No edit summary
Line 116: Line 116:
* Example for checking that there is a title set for the current page:
* Example for checking that there is a title set for the current page:
  Element awesomebar = mDriver.findElement(getActivity(), "awesome_bar_title");
  Element awesomebar = mDriver.findElement(getActivity(), "awesome_bar_title");
  mAsserter.isnot(awesomebar, null, "Got the awesomebar"); // Checks that the awesomebar title is not null and posts in the logs
  mAsserter.isnot(awesomebar, null, "Got the awesomebar"); // Checks that the awesomebar title
  is not null and posts in the logs


== Test an object is the same as a second object ==
== Test an object is the same as a second object ==
Line 126: Line 127:
  mSolo.waitForText(url);
  mSolo.waitForText(url);
   
   
  mAsserter.is(list.getChildCount(), 5, "all pages list has 5 children (the default bookmarks)"); // Checks that there are 5 entries in the list and posts in the logs
  mAsserter.is(list.getChildCount(), 5, "all pages list has 5 children (the default bookmarks)"); // Checks that  
there are 5 entries in the list and posts in the logs


== Write text in logs ==
== Write text in logs ==
Line 140: Line 142:
  mSolo.waitForText(url);
  mSolo.waitForText(url);
   
   
  mAsserter.ok(list != null, "checking that all pages list exists", list.toString()); // tests if the list is null and if it isn't it prints the list after printing the message of what the test does
  mAsserter.ok(list != null, "checking that all pages list exists", list.toString()); // tests if  
the list is null and if it isn't it prints the list after printing the message of what the test does
Confirmed users
905

edits