Acceptance tests
Login page should have inputs and validate submit
Login page should have input[name=subdomain], input[name=username], input[name=password] and should validate inputs on submit.
Given an bb-classic app login page
Then page should contain Please enter you credentials
And page should contain element name=subdomain
And page should contain element name=username
And page should contain element name=password
When enter subdomain field
And click button Log in
Then page should contain Please enter all fields!
When enter username field
And click button Log in
Then page should contain Please enter all fields!
When enter password field
And click button Log in
Then Wait Until Page Contains First Last
My profile page should contains my info
My profile page should contains info about me.
Given an bb-classic app
When go to my profile page
Then my info be visible
Projects page should contains links to projects
Projects page should contains correct links to projects if company and projects state selected.
Given an projects page
And wait for data loading
When click on "Company name #0" in active state
Then link to Name of #0 should be visible
And link to Name of #5 should not be visible
And link to Name of #10 should not be visible
And link to Name of #15 should be visible
And link to Name of #20 should not be visible
And link to Name of #25 should not be visible
When click on "Company name #0" in on_hold state
Then link to Name of #0 should not be visible
And link to Name of #5 should not be visible
And link to Name of #10 should be visible
And link to Name of #15 should not be visible
And link to Name of #20 should not be visible
And link to Name of #25 should be visible
When click on "Company name #0" in archived state
Then link to Name of #0 should not be visible
And link to Name of #5 should be visible
And link to Name of #10 should not be visible
And link to Name of #15 should not be visible
And link to Name of #20 should be visible
And link to Name of #25 should not be visible
Project navigation should work correctly
Projects navigation should change location and heading correctly.
Given an projects page
And wait for data loading
When click link Name of #0
Then location should be ${APP_URL}/#projects/0
And heading should be "Name of #0"
And title should be Name of #0 - Projects - Company name #0 - Companies - BB
When click on "Messages" in projectnav
Then location should be ${APP_URL}/#projects/0/posts
And heading should be "Posts"
And title should be Posts - Name of #0 - Projects - Company name #0 - Companies - BB
And wait for data loading
When click link Title #0
Then location should be ${APP_URL}/#projects/0/posts/0
And heading should be "Title #0"
And title should be Title #0 - Posts - Name of #0 - Projects - Company name #0 - Companies - BB
When click element css=.itemcomments
Then location should be ${APP_URL}/#projects/0/posts/0/comments
And heading should be "Comments"
And title should be Comments - Title #0 - Posts - Name of #0 - Projects - Company name #0 - Companies - BB
When click on "To-Dos" in projectnav
Then location should be ${APP_URL}/#projects/0/todo_lists
And heading should be "To-dos"
And title should be To-dos - Name of #0 - Projects - Company name #0 - Companies - BB
And wait for data loading
When click link css=a[href$='todo_lists/0']
Then location should be ${APP_URL}/#projects/0/todo_lists/0
And heading should be "Name of #0"
And title should be Name of #0 - To-dos - Name of #0 - Projects - Company name #0 - Companies - BB
And wait for data loading
When click link Todo content #0
Then location should be ${APP_URL}/#projects/0/todo_lists/0/0
And heading should be "Todo content #0"
And title should be Todo content #0 - Name of #0 - To-dos - Name of #0 - Projects - Company name #0 - Companies - BB
When click element css=.itemcomments
Then location should be ${APP_URL}/#projects/0/todo_lists/0/0/comments
And heading should be "Comments"
And title should be Comments - Todo content #0 - Name of #0 - To-dos - Name of #0 - Projects - Company name #0 - Companies - BB
When click on "Calendar" in projectnav
Then location should be ${APP_URL}/#projects/0/calendar
And heading should be "Calendar"
And title should be Calendar - Name of #0 - Projects - Company name #0 - Companies - BB
And wait for data loading
When click link Title #0
Then location should be ${APP_URL}/#projects/0/calendar/0
And heading should be "Title #0"
And title should be Title #0 - Calendar - Name of #0 - Projects - Company name #0 - Companies - BB
When click element css=.itemcomments
Then location should be ${APP_URL}/#projects/0/calendar/0/comments
And heading should be "Comments"
And title should be Comments - Title #0 - Calendar - Name of #0 - Projects - Company name #0 - Companies - BB
When click on "Time" in projectnav
Then location should be ${APP_URL}/#projects/0/time_entries
And heading should be "Time"
And title should be Time - Name of #0 - Projects - Company name #0 - Companies - BB
When click on "Files" in projectnav
Then location should be ${APP_URL}/#projects/0/files
And heading should be "Files"
And title should be Files - Name of #0 - Projects - Company name #0 - Companies - BB
And wait for data loading
When click link css=a[href$='files/0']
Then location should be ${APP_URL}/#projects/0/files/0
And heading should be "Name of #0"
And title should be Name of #0 - Files - Name of #0 - Projects - Company name #0 - Companies - BB
When click on "Categories" in projectnav
Then location should be ${APP_URL}/#projects/0/categories
And heading should be "Categories"
And title should be Categories - Name of #0 - Projects - Company name #0 - Companies - BB
And wait for data loading
When click link css=a[href$='categories/0']
Then location should be ${APP_URL}/#projects/0/categories/0
And heading should be "Name of #0"
And title should be Name of #0 - Categories - Name of #0 - Projects - Company name #0 - Companies - BB
When click on "People" in projectnav
Then location should be ${APP_URL}/#projects/0/people
And heading should be "People"
And title should be People - Name of #0 - Projects - Company name #0 - Companies - BB
And wait for data loading
When click link First#0 Last
Then location should be ${APP_URL}/#projects/0/people/0
And heading should be "First#0 Last"
And title should be First#0 Last - People - Name of #0 - Projects - Company name #0 - Companies - BB
User can edit delete and sort time entries on time report page
User should edit, delete and sort time entries.
Given an time report page
When user edit time entry
Then page should contain edited entry
When user delete time entry
Then page should not contain deleted entry
When user sort time entries
Then page should contain sorted entries
User can add edit delete and sort time entries on project time page
User should add, edit, delete and sort time entries.
Given an project time page
When user edit time entry
Then page should contain edited entry
When user delete time entry
Then page should not contain deleted entry
When user sort time entries
Then page should contain sorted entries
When user add time entry
Then page should contain added entry
User can view todos for it and other users
User should view to-dos for it, other users and unassigned.
Given an to-dos page
When select from list target First#1 Last
Then Wait Until Page Contains First#1 Last's to-do items across all projects
And heading should be "First#1 Last's to-dos"
When select from list target Nobody
Then Wait Until Page Contains Unassigned to-do items across all projects
And heading should be "Unassigned to-dos"
User can add edit and delete todo lists and items
User should add, edit and delete todo lists and items.
Given an project todos page
When user add todo list
Then page should contain added todo list
When user edit todo list
Then page should contain edited todo list
When user delete todo list
Then page should not contain deleted todo list
When click link css=a[href$='todo_lists/0']
When user add todo item
Then page should contain added todo item
When user edit todo item
Then page should contain edited todo item
When user delete todo item
Then page should not contain deleted todo item
User can edit and delete calendar entries on project calendar page
User should edit and delete calendar entries.
Given an project calendar page
When user edit calendar entry
Then page should contain edited entry
When user delete calendar entry
Then page should not contain deleted entry
Acceptance tests keywords
go to my profile page
Go to my profile page thru the user actions menu.
Click link First Last
Click link My profile
Location should be ${APP_URL}/#me
my info be visible
Check if page contains user info.
Page should contain element link=name@domain.com
Page should contain element link=example
Page should contain Mobile: +000 (00) 000-0000
Page should contain Home: +000 (00) 000-0001
Page should contain Fax: +000 (00) 000-0002
Page should contain Office: +000 (00) 000-0003
Page should contain Time zone: Europe/Kiev
an projects page
Go to projects page.
Given Test user login
Then click link Projects
click on ${text} in ${state} state
Click on link in state block.
${text}${state}
Click on ${text} in ${state} state and wait effect
link to ${name} should be visible
Check if link is visible.
${name}
Element Should Be Visible link=${name}
link to ${name} should not be visible
Check if link is not visible.
${name}
Element Should Not Be Visible link=${name}
an bb-classic app
Go to application page.
an bb-classic app login page
Go to application login page.
Reload Page Until Location should contain login
Page should contain BB
Title should be BB
enter ${name} field
Enter “test” text in input field.
${name}
Input Text name=${name} test
click on ${name} link in navbar
Click on link in navbar.
${name}
Click link xpath=//*[contains(@class,"navbar")]//a[contains(text(),${name})]
heading should be ${heading}
Check if heading contain text.
${heading}
Page should contain element xpath=//h1[contains(text(),${heading})]
Wait for data loading
Waiting for loading data from server.
Wait Until Keyword Succeeds 10 sec 0.1 sec Element Should Not Be Visible css=.alert
Click on ${text} in ${state} state and wait effect
Switch state filter, wait, click on link in state block and wait.
${text}${state}
Click link ${state}
Wait Until Keyword Succeeds 5 sec 0.1 sec Element Should Be Visible xpath=//*[@id="projects_${state}"]//a[contains(text(),${text})]
Click element xpath=//*[@id="projects_${state}"]//a[contains(text(),${text})]
Wait Until Keyword Succeeds 5 sec 0.1 sec Element Should Be Visible xpath=//*[@id="projects_${state}"]//*[@id="projects_${state}_${text[-2]}"]//a
Click on ${text} in projectnav
Click on link in project navigation.
${text}
Click element xpath=//*[contains(@class,"projectnav")]//a[contains(text(),${text})]
Wait for data loading
Start app
Start application.
${PRO_TEST} = Get Environment Variable PRO_TEST False
Run Keyword If '${PRO_TEST}' != 'True' Start Process bin/dev_appserver app --skip_sdk_update_check ELSE Start Process bin/dev_appserver app --skip_sdk_update_check --auth_domain=Production
Start Browser For Test
Start browser.
Start browser
Set Window Size 1024 768
Close All Browsers and Report Status
Close browser and report test status.
Close All Browsers
Report test status
Stop app
Stop application.
Run pkill -f dev_appserver
${out} = Read Process Output
Append to file app.log ${out}
Stop All Processes
Reload Page Until
Reload page 10 times until condition will be true.
: FOR ${try} IN RANGE 10
\ ${status}= Run Keyword And Ignore Error @{condition}
\ ${raise error}= Set Variable If ${status}[0]=='PASS' 'False' 'True'
\ Run Keyword If ${status}[0]=='PASS' Exit For Loop
\ Sleep 1 Waiting for loading server
\ Go to ${APP_URL}
Run Keyword If ${raise error}=="True" Fail "${condition}"
Test user login
Login by test user.
Reload Page Until Location should contain login
Input Text name=subdomain test
Input Text name=username test
Input Password name=password test
Click button Log in
Sleep 2 Waiting for loading app
Wait Until Page Contains First Last 15 sec
Test user logout
Logout.
Click link First Last
Click link Logout
Start browser
Prepare environment and start browser.
${BROWSER} = Get Environment Variable ROBOT_BROWSER Firefox
${REMOTE_URL} = Get Environment Variable ROBOT_REMOTE_URL ${REMOTE_URL}
${BUILD_MANUAL} = Evaluate random.randint(0,10**6) random
${BUILD_NUMBER} = Get Environment Variable ROBOT_BUILD_NUMBER manual-${BUILD_MANUAL}
${DESIRED_CAPABILITIES} = Get Environment Variable ROBOT_DESIRED_CAPABILITIES platform:Linux
${BUILD_TAGS} = Evaluate " ".join(${TEST_TAGS})
${BUILD_INFO} = Set variable build:${BUILD_NUMBER},name:${TEST_NAME},tags:${BUILD_TAGS},public:public
Open browser ${APP_URL} ${BROWSER} remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES},${BUILD_INFO}
Run keyword unless '${REMOTE_URL}' == '' Run keyword and ignore error Set session id
Set session id
Get session id and set variable.
Keyword should exist Get session id
${SESSION_ID} = Get session id
Set test variable ${SESSION_ID} ${SESSION_ID}
Report test status
Report test status to saucelabs.
Run keyword unless '${SESSION_ID}' == '' Report sauce status ${SESSION_ID} ${TEST_STATUS}
an time report page
Given an bb-classic app
When click on "Time" link in navbar
Then wait for data loading
an project time page
Given an bb-classic app
When click link Name of #0
And click on "Time" in projectnav
Then wait for data loading
user add time entry
user can add time entry
Wait Until Page Contains Element css=tr.addtime button.additem
Input Text css=tr.addtime [name="description"] added description
Click Button css=tr.addtime button.additem
page should contain added entry
added item should be present
Wait Until Page Contains added description
user edit time entry
user can edit time entry
Wait Until Page Contains Element css=tr[data-id="0"] button.edit
Click Button css=tr[data-id="0"] button.edit
Wait Until Page Contains Element css=tr.edittime[data-id="0"] [name="description"]
Input Text css=tr.edittime[data-id="0"] [name="description"] edited description
Click Button css=tr[data-id="0"] button.save
page should contain edited entry
edited item should be present
Wait Until Page Contains edited description
user delete time entry
user can delete time entry
Wait Until Page Contains Element css=tr[data-id="0"] button.remove
Click Button css=tr[data-id="0"] button.remove
page should not contain deleted entry
deleted item should not be present
Page should not contain edited description
user sort time entries
sort time entries by date
Click Element xpath=//table/thead/tr/th[contains(text(), "date")]
page should contain sorted entries
time entries must be sorted
Page should contain 2012-12-24
Page should not contain 2001-01-01
an to-dos page
Given an bb-classic app
When click on "To-Dos" link in navbar
Then wait for data loading
And heading should be "My to-dos"
an project todos page
Given an bb-classic app
When click link Name of #0
And click on "To-Dos" in projectnav
Then wait for data loading
user add todo list
user can add todo list
Click button Add an item
Input Text todoName added todo list
Input Text todoDescription added descrition
Click Element css=.additem
page should contain added todo list
added item should be present
Wait Until Page Contains added todo list
Wait Until Page Contains added descrition
user edit todo list
user can edit todo list
Click Element css=.todolist.edititem[data-id="30"]
Input Text todoName30 edited todo list
Input Text todoDescription30 edited descrition
Click Element css=.save
page should contain edited todo list
edited item should be present
Wait Until Page Contains edited todo list
Wait Until Page Contains edited descrition
user delete todo list
user can delete todo list
Click Element css=.todolist.removeitem[data-id="30"]
page should not contain deleted todolist
deleted item should not be present
Page should not contain edited todo list
Page should not contain edited description
user add todo item
user can add todo item
Click button Add an item
Input Text todoContent added todo item
Click Element css=.additem
page should contain added todo item
added item should be present
Wait Until Page Contains added todo item
user edit todo item
user can edit todo item
Click Element css=.todo.edititem[data-id="30"]
Input Text todoContent30 edited todo item
Click Element css=.save
page should contain edited todo item
edited item should be present
Wait Until Page Contains edited todo item
user delete todo item
user can delete todo item
Click Element css=.todo.removeitem[data-id="30"]
page should not contain deleted todoitem
deleted item should not be present
Page should not contain edited todo item
an project calendar page
Given an bb-classic app
When click link Name of #0
And click on "Calendar" in projectnav
Then wait for data loading
user edit calendar entry
user can edit calendar entry
Wait Until Page Contains Element css=.edititem[data-id="0"]
Click Element css=.edititem[data-id="0"]
Wait Until Page Contains Element css=.editcalendar[data-id="0"] [name="title"]
Input Text css=.editcalendar[data-id="0"] [name="title"] edited title
Click Button css=[data-id="0"] button.save
page should contain edited entry
edited item should be present
Wait Until Page Contains edited title
user delete calendar entry
user can delete calendar entry
Wait Until Page Contains Element css=.removeitem[data-id="0"]
Click Element css=.removeitem[data-id="0"]
page should not contain deleted entry
deleted item should not be present
Page should not contain edited title
Keywords for tests
-
keywords.compare_screenshot_to_base(baseline, diff=100)[source]
Calculate the exact difference between two images.
Parameters: |
- baseline (string) – [required] base screenshot to compare
- diff (int) – value of maximum difference
|
Example:
Compare screenshot to base base_screenshot.jpg
-
keywords.get_session_id()[source]
Get session id
Returns: | session id |
Return type: | string |
Example:
${SESSION_ID} = Get Session Id
-
keywords.report_sauce_status(job_id, test_status)[source]
Report test status to Sauce service
Parameters: |
- job_id (string) – [required] saucelabs job id
- test_status (string) – [required] status of test
|
Returns: | request status code
|
Return type: | int or string
|
Example:
Report sauce status ${SESSION_ID} ${TEST_STATUS}