Skip to content

Commit

Permalink
Clean up example script
Browse files Browse the repository at this point in the history
  • Loading branch information
atthaboon committed May 26, 2020
1 parent 3bce11b commit 654086a
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 26 deletions.
5 changes: 2 additions & 3 deletions Examples/BasicDataDrivenExample.robot
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*** Setting ***
Library ExcelDataDriver ./test_data/BasicDemoData.xlsx capture_screenshot=Skip
Library ExcelDataDriver ./test_data/BasicDemoData.xlsx capture_screenshot=Skip main_column_key=username
Test Template Validate user data template

*** Test Cases ***
Expand All @@ -11,5 +11,4 @@ Validate user data template
Log ${username}
Log ${password}
Log ${email}
Should Be True '${password}' != '${None}'
# Should Match Regexp ${email} [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}
Should Not Be Equal ${password} ${None}
8 changes: 4 additions & 4 deletions Examples/CustomExcelParser/CustomExcelParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

class CustomExcelParser(ABCParserStrategy):

def __init__(self):
ABCParserStrategy.__init__(self)
def __init__(self, main_column_key=None):
ABCParserStrategy.__init__(self, main_column_key)
print('Using CustomExcelParser')
self.maximum_column_index_row = 3
self.start_row = 1
self.maximum_column_index_row = 2
self.start_row = 3

def parsing_column_indexs(self, ws):
'''
Expand Down
6 changes: 3 additions & 3 deletions Examples/CustomParserExample.robot
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*** Setting ***
Library CustomExcelParser/CustomExcelParser.py
Library ExcelDataDriver ./test_data/Custom_Template.xlsx custom_parser=CustomExcelParser capture_screenshot=OnFailed
Library CustomExcelParser/CustomExcelParser.py
Library ExcelDataDriver ./test_data/Custom_Template.xlsx main_column_key=sku custom_parser=CustomExcelParser capture_screenshot=OnFailed
Test Template Demo template


*** Test Cases ***
Product promo price update for SKU '${sku}' ${None} ${None} ${None} ${None} ${None} ${None} ${None} ${None} ${None}

*** Keywords ***
Demo template
[Arguments] ${sku} ${normal price} ${normal cost in vat} ${normal cost ex vat} ${normal cost gp} ${promotion price} ${promotion cost in vat} ${promotion cost ex vat} ${promotion cost gp}
Expand Down
5 changes: 2 additions & 3 deletions Examples/MergedSummaryReportExample.robot
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
*** Setting ***
Library String
Library Collections
Library OperatingSystem
Library SeleniumLibrary
Library OperatingSystem
Library ./CustomExcelParser/CustomExcelParser.py
Library ExcelDataDriver manually_test=${True}


*** Tasks ***
Summary_test_result
Merged Excel Report CustomExcelParser
Merged Excel Report sku CustomExcelParser
12 changes: 0 additions & 12 deletions Examples/Parse_Product_Removal_Activity.robot

This file was deleted.

2 changes: 1 addition & 1 deletion Examples/SeleniumDataDrivenExample.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** Setting ***
Library SeleniumLibrary
Library ExcelDataDriver ./test_data/DefaultDemoData.xlsx capture_screenshot_when_fail_only=${True}
Library ExcelDataDriver ./test_data/DefaultDemoData.xlsx main_column_key=username capture_screenshot=OnFailed
Test Template Invalid login
Suite Teardown Close All Browsers

Expand Down
Binary file modified Examples/test_data/BasicDemoData.xlsx
Binary file not shown.
Binary file modified Examples/test_data/Custom_Template.xlsx
Binary file not shown.
Binary file not shown.

0 comments on commit 654086a

Please sign in to comment.