Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved tests for partner day #444

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added v2/data/web-store-order-processor/Data1.xlsx
Binary file not shown.
Binary file added v2/data/web-store-order-processor/Data2.xlsx
Binary file not shown.
Binary file added v2/data/web-store-order-processor/Data3.xlsx
Binary file not shown.
18 changes: 7 additions & 11 deletions v2/data/web-store-order-processor/conda.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# For more details on the format and content:
# https://github.com/robocorp/rcc/blob/master/docs/recipes.md#what-is-in-condayaml
# Tip: Adding a link to the release notes of the packages helps maintenance and security.

channels:
- conda-forge

dependencies:
- python=3.10.12 # https://pyreadiness.org/3.10
- pip=23.2.1 # https://pip.pypa.io/en/stable/news
- robocorp-truststore=0.8.0 # https://pypi.org/project/robocorp-truststore/
- nodejs=18.17.1 # https://github.com/nodejs/node/blob/main/CHANGELOG.md
- python=3.10.12
- pip=23.2.1
- robocorp-truststore=0.8.0
- nodejs=18.17.1
- pip:
- robotframework-browser==17.5.2 # https://github.com/MarketSquare/robotframework-browser/releases
- rpaframework==27.6.0 # https://rpaframework.org/releasenotes.html
- robotframework-browser==17.5.2
- rpaframework==27.6.0

rccPostInstall:
- rfbrowser init # Initialize Playwright
- rfbrowser init
17 changes: 9 additions & 8 deletions v2/data/web-store-order-processor/libraries/Orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ def get_orders(self, excel):

orders = []
for row in table:
first_name, last_name = row["Name"].split()
order = {
"item": row["Item"],
"zip": int(row["Zip"]),
"first_name": first_name,
"last_name": last_name
}
orders.append(order)
if len(row["Name"]):
first_name, last_name = row["Name"].split()
order = {
"item": row["Item"],
"zip": int(row["Zip"]),
"first_name": first_name,
"last_name": last_name
}
orders.append(order)

return orders
21 changes: 14 additions & 7 deletions v2/data/web-store-order-processor/tasks.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Documentation Swag order robot. Places orders at https://www.saucedemo.com
Library OperatingSystem
Library Orders
Library RPA.Browser.Playwright
Library RPA.HTTP
Library RPA.Robocorp.Vault
# Library RPA.Robocorp.Vault


*** Variables ***
Expand All @@ -18,15 +17,22 @@ ${SWAG_LABS_URL}= https://www.saucedemo.com


*** Tasks ***
Place orders
Process orders
First Order
Process orders 1

Second Order
Process orders 2

Third Order
Process orders 3


*** Keywords ***
Process orders
[Arguments] ${file}
Open Swag Labs
Login standard_user secret_sauce
${orders}= Collect orders
${orders}= Collect orders ${file}
FOR ${order} IN @{orders}
Run Keyword And Continue On Failure Process order ${order}
END
Expand All @@ -51,8 +57,9 @@ Assert logged in
Get Url == ${SWAG_LABS_URL}/inventory.html

Collect orders
RPA.HTTP.Download ${EXCEL_FILE_URL} overwrite=True
${orders}= Get Orders ${EXCEL_FILE_NAME}
[Arguments] ${datafile}
#RPA.HTTP.Download ${EXCEL_FILE_URL} overwrite=True
${orders}= Get Orders ${CURDIR}${/}Data${datafile}.xlsx
RETURN ${orders}

Process order
Expand Down
5 changes: 0 additions & 5 deletions v2/data/windows-example-calculator/conda.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Generated environment configuration file.

# Editing this file manually can prevent the project from being
# opened in Automation Studio.

channels:
- conda-forge
dependencies:
Expand Down
14 changes: 12 additions & 2 deletions v2/data/windows-example-calculator/robot.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
tasks:
Count My Veggies:
robotTaskName: Count My Veggies
Calc Demo:
command:
- python
- -m
- robot
- --report
- NONE
- -d
- output
- --logtitle
- Task log
- tasks.robot
condaConfigFile: conda.yaml
ignoreFiles:
- .gitignore
Expand Down
18 changes: 9 additions & 9 deletions v2/data/windows-example-calculator/tasks.robot
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ ${OUTPUT_EXCEL} ${OUTPUT_DIR}${/}calculation_results.xlsx


*** Tasks ***
Count My Veggies
Do Calculations
[Documentation] A sample robot that reads two columns of input and outputs calculations
Check Veggies Excel And Start Calculator
${inputs}= Read Veggies Excel
${outputs}= Count Veggie Totals ${inputs}
Save Veggie Results Excel ${outputs}
Check Input FIle And Start Calculator
${inputs}= Read Input Excel
${outputs}= Calculate ${inputs}
Save Results In Excel ${outputs}
Close Window name:Calculator


*** Keywords ***
Read Veggies Excel
Read Input Excel
[Documentation] Reads the Excel sheet for veggies
Open Workbook ${INPUT_EXCEL}
${inputs}= Read Worksheet As Table Sheet1 ${TRUE} ${TRUE}
Close Workbook
RETURN ${inputs}

Count Veggie Totals
Calculate
[Documentation] Counts the total amounts with Calculator Application
[Arguments] ${table}
${totals}= Create List
Expand All @@ -57,7 +57,7 @@ Input Number To Calc
Click Calculator - ${digit}
END

Save Veggie Results Excel
Save Results In Excel
[Documentation] Writes the Excel sheet for total amounts of veggies
[Arguments] ${outputs}
Create Workbook ${CURDIR}${/}calculation_results.xlsx xlsx
Expand All @@ -81,7 +81,7 @@ Get Result From Calc
${total}= Convert To Integer ${total}
RETURN ${total}

Check Veggies Excel And Start Calculator
Check Input FIle And Start Calculator
${exists}= Does File Exist ${INPUT_EXCEL}
IF not $exists Fail Missing input: ${INPUT_EXCEL}
Windows Search Calculator
Loading