Skip to content

Commit

Permalink
Webstore suite with 3 tests, removed XLS download
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Meggle committed Dec 8, 2023
1 parent 53300ef commit 11bed27
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
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.
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

0 comments on commit 11bed27

Please sign in to comment.