Where are the tests?Edit
In the MobileFrontend extension these can be found in tests/browser.
You can run QA tests by running
make cucumber from the MobileFrontend directory.
Questions and Answers about writing automation testsEdit
Is there a user that exists in en.m, test2.m and en.m betalabs?
- Yes Selenium_user exists. This user has performed uploads and a variety of tests.
How do I use Selenium_user to log in?
- If you would like to log in using Selenium_user you would go to your feature file and type in "Given/When/Then ... I am logged into the mobile website"
Is there a user that hasn't uploaded or edited? A user who just logs in?
- Yes. I created a user "Selenium_newuser" who has the same password as "Selenium_user". This user is used to test the upload tutorial in the Uploads.Feature test. If you use the following in your feature "Given/When/Then… I am logged in as a new user" then you will be able to call this piece of code in your Feature. *** Please don't upload or edit with this user, we want to keep this as a "first time user" without always creating a new user.
How do I test in beta mode?
- If you would like to use it in your feature you would use "Given/When/Then… I am in beta mode"
How do I test in alpha mode?
- The code for switching to Alpha mode has not been completed. There were some pain points in switching to Alpha because beta and alpha are using the same class but this can probably be done now that there are actual id's to call instead of the class. If I want to write the code to do this is there an example? Yes see watchlist_steps.rb -> Given I am in beta mode. Either create a new page (alpha_page.rb) or rename beta_page.rb to something more fitting for both like switch_modes_page.rb for example. Add an element to switch into alpha mode.
How do I add an article to a users watchlist?
- "Given/When/Then … I click on the watchlist icon"
How do I select a Random Article?
- "Given/When/Then … I go to random page"
How do I pass a user agent to my test?
- See the "random_ua.feature/random_ua_steps.rb". "Given/When/Then… that I am using <insert ua string>"
How do I select a specific article?
- See the external_links.feature/external_links_steps.rb. "Given/When/Then… I am on the <my_article> article"
How do I navigate to the home page?
- "Given/When/Then… I am on the home page"