-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.12-slim-bookworm | ||
|
||
COPY . . | ||
|
||
RUN pip install -r requirements/dev.txt | ||
|
||
RUN pip install . | ||
|
||
ENTRYPOINT ["robot", "integration-tests/login"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
*** Settings *** | ||
Resource resource.robot | ||
Suite Setup Setup | ||
Suite Teardown Teardown | ||
|
||
*** Keywords *** | ||
Setup | ||
Create Visual Build | ||
|
||
Teardown | ||
Finish Visual Build | ||
Visual Build Status |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*** Settings *** | ||
Library saucelabs_visual.frameworks.robot.SauceLabsVisual |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
*** Settings *** | ||
Documentation A test suite with a single test for valid login. | ||
... | ||
... This test has a workflow that is created using keywords in | ||
... the imported resource file. | ||
Resource resource.robot | ||
Suite Setup Open Browser browser=${BROWSER} remote_url=${REMOTE URL} options=set_capability('sauce:options', ${DESIRED CAPABILITIES}) | ||
Suite Teardown Close Browser | ||
|
||
*** Test Cases *** | ||
Valid Login | ||
Open Browser To Login Page | ||
${username} = Setup User | ||
Input Username ${username} | ||
Input Password secret_sauce | ||
Submit Credentials | ||
Welcome Page Should Be Open | ||
Visual Snapshot Valid Login capture_dom=True | ||
|
||
Invalid Login | ||
Open Browser To Login Page | ||
Input Username locked_out_user | ||
Input Password secret_sauce | ||
Submit Credentials | ||
Login Page Should Be Open | ||
Visual Snapshot Invalid Login capture_dom=True |
64 changes: 64 additions & 0 deletions
64
visual-python/integration-tests/login/tests/resource.robot
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
*** Settings *** | ||
Documentation A resource file with reusable keywords and variables. | ||
... | ||
... The system specific keywords created here form our own | ||
... domain specific language. They utilize keywords provided | ||
... by the imported SeleniumLibrary. | ||
Library SeleniumLibrary | ||
Library saucelabs_visual.frameworks.robot.SauceLabsVisual | ||
|
||
*** Variables *** | ||
${BROWSER} Chrome | ||
${DELAY} 0 | ||
${LOGIN URL} https://www.saucedemo.com/ | ||
${INVENTORY PAGE} https://www.saucedemo.com/inventory.html | ||
# NOTE: If using an ondemand Sauce region other than us-west-1, you need to supply the matching | ||
# region to the `SAUCE_REGION` ENV before visual build creation to have it utilize the same | ||
# datacenter. | ||
# Ex: | ||
# REMOTE URL=https://ondemand.eu-central-1.saucelabs.com/wd/hub | ||
# SAUCE_REGION=eu-central-1 | ||
${REMOTE URL} https://ondemand.us-west-1.saucelabs.com:443/wd/hub | ||
${DESIRED CAPABILITIES} {"username": "%{SAUCE_USERNAME}", "accessKey": "%{SAUCE_ACCESS_KEY}", "sauce:options": {"browser_version": "latest", "platform_name": "Windows 11", "browser": "chrome"}} | ||
|
||
*** Keywords *** | ||
Open Browser To Login Page | ||
Go To ${LOGIN URL} | ||
Maximize Browser Window | ||
Set Selenium Speed ${DELAY} | ||
Login Page Should Be Open | ||
|
||
Login Page Should Be Open | ||
Location Should Be ${LOGIN URL} | ||
Title Should Be Swag Labs | ||
|
||
Go To Login Page | ||
Go To ${LOGIN URL} | ||
Login Page Should Be Open | ||
|
||
Input Username | ||
[Arguments] ${username} | ||
Input Text user-name ${username} | ||
|
||
Input Password | ||
[Arguments] ${password} | ||
Input Text password ${password} | ||
|
||
Submit Credentials | ||
Click Button login-button | ||
|
||
Welcome Page Should Be Open | ||
Location Should Be ${INVENTORY PAGE} | ||
Title Should Be Swag Labs | ||
|
||
Setup User | ||
TRY | ||
IF "%{VISUAL_CHECK}" == "1" | ||
VAR ${username} visual_user | ||
ELSE | ||
VAR ${username} standard_user | ||
END | ||
EXCEPT | ||
VAR ${username} standard_user | ||
END | ||
RETURN ${username} |