11*** Settings ***
22Library SeleniumLibrary
33Library mark-test-status.py
4- Library manage-local-testing.py
54
65*** Variables ***
7- ${USERNAME } = %{BROWSERSTACK_USERNAME }
8- ${ACCESSKEY } = %{BROWSERSTACK_ACCESS_KEY }
9- ${REMOTE_URL } = https://${USERNAME } :${ACCESSKEY } @hub.browserstack.com/wd/hub
6+ ${remote_url } = https://hub.browserstack.com/wd/hub
107
118*** Keywords ***
129Open Session
13- [Arguments] ${capabilities } ${ website_url }
14- open browser remote_url=${REMOTE_URL } desired_capabilities=${capabilities } url=${website_url }
10+ [Arguments] ${capabilities } ${ test_url }
11+ open browser remote_url=${remote_url } desired_capabilities=${capabilities } url=${test_url }
1512
1613Close Session
1714 close browser
@@ -23,13 +20,8 @@ Mark Test Status
2320 [Arguments] ${status } ${reason }
2421 TEST STATUS ${status } ${reason }
2522
26- Setup for local test
27- START LOCAL
28- Open Session ${LOCAL_CAPS } ${WEBSITE_URL }
29-
30- Teardown for local test
31- Close Session
32- STOP LOCAL
23+ Get the page title
24+ get title
3325
3426Click on Sign In
3527 click element id=signin
@@ -56,3 +48,13 @@ Verify site content
5648 run keyword if "${site_content } " == "Up and running" mark test status passed Site Content validated!
5749 run keyword if "${site_content } " != "Up and running" mark test status failed Site Content validation failed!
5850 element should contain css=body Up and running
51+
52+ Add first product to cart
53+ click element xpath=//*[@id="1"]/div[4]
54+
55+ Verify product is added to cart
56+ ${product_name } get text xpath=//*[@id="1"]/p
57+ ${product_incart } get text css=p.title
58+ run keyword if "${product_name } " == "${product_incart } " mark test status passed Correct product added!
59+ run keyword if "${product_name } " != "${product_incart } " mark test status failed Something went wrong!
60+ element should contain css=p.title ${product_name }
0 commit comments