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

Allow other optional columns to be the first column #63

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions atest/TestCases/first_col/documentation.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Documentation];${expected}
Doc1;Doc1
Doc2;Doc2
13 changes: 13 additions & 0 deletions atest/TestCases/first_col/documentation.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*** Settings ***
Library DataDriver encoding=UTF8
Test Template Check


*** Test Cases ***
Documentation should be ${expected}


*** Keywords ***
Check
[Arguments] ${expected}
Should Be Equal ${TEST DOCUMENTATION} ${expected}
3 changes: 3 additions & 0 deletions atest/TestCases/first_col/tags.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Tags];${expected}
tag1;tag1
tag2;tag2
13 changes: 13 additions & 0 deletions atest/TestCases/first_col/tags.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*** Settings ***
Library DataDriver encoding=UTF8
Test Template Check


*** Test Cases ***
Tags should containe ${expected}


*** Keywords ***
Check
[Arguments] ${expected}
Should Be Equal ${TEST TAGS}[0] ${expected}
8 changes: 6 additions & 2 deletions src/DataDriver/AbstractReaderClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,14 @@ def _read_data_from_table(self, row):
)
tags = (
[t.strip() for t in row[self.tags_column_id].split(",")]
if self.tags_column_id
if self.tags_column_id is not None
else None
)
documentation = row[self.documentation_column_id] if self.documentation_column_id else ""
documentation = (
row[self.documentation_column_id]
if self.documentation_column_id is not None
else ""
)

self.data_table.append(TestCaseData(test_case_name, arguments, tags, documentation))

Expand Down