Last active
December 28, 2015 07:29
-
-
Save MaxMorais/7464629 to your computer and use it in GitHub Desktop.
report-role test case with lettuce/salad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Ensuring that report-role works, and the page loads | |
In order to make sure that report-role works | |
As a tester | |
I open the ERPNext website using salad | |
Scenario Outline: Login in erpnext as test user with JS enabled (firefox) | |
Given I am using firefox | |
When I visite the local erpnext test url "login" | |
And I wait 1 second | |
And I fill the field <finder_login_id> with "[email protected]" | |
And I fill the field <finder_login_psw> with "test" | |
And I click the button <finder_buttom> | |
And I wait 1 seconds | |
Then I should see "Test User" somewhere in the page | |
Examples: | |
| finder_login_id | finder_login_psw | finder_button | | |
| with the id "login_id"| with the id "pass" | with the id "login_btn" | | |
Scenario: Goto report and check if it works fine | |
Given I am using firefox | |
When I visite the local erpnext test url "#Form/Report/New Report 1" | |
And I wait 1 second | |
Then I should see "New Report 1" somewhere in the page | |
Scenario: Select the "Sales Invoice" and wait for "Customer" in roles table | |
Given I am using firefox | |
When I visite the local erpnext test url "#Form/Report/New Report 1" | |
And I wait 1 second | |
And I fill the field with the css selector "input[data-fieldname='ref_doctype']" with "Sales Invoice" | |
And I wait 1 second | |
Then I should see "Customer" somewhere in the page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from salad.steps.everything import * | |
@step(r'visite the local erpnext test url "(*.)"') | |
def go_to_the_erpnext_test_url(step, url): | |
try: | |
go_to_the_url(step, "http://localhost:8000/%s"%url) | |
except: | |
go_to_the_url(step, "http://localhost:8000/%s"%url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from salad.terrains.everything import * | |
@before.each_scenario | |
def auto_login(step): | |
browser = setup_browser('firefox', 'http://localhost:8000/login') | |
browser.find_by_id("login_id").first.fill('test@localhost') | |
browser.find_by_id("pass").first.fill('test') | |
browser.find_by_id("login_btn").first.click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment