-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YDA-5512: Remove suffixes in import csv
- Loading branch information
Showing
10 changed files
with
201 additions
and
62 deletions.
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 |
---|---|---|
|
@@ -159,7 +159,7 @@ Feature: Group API | |
|
||
Scenario Outline: Group import CSV | ||
Given user technicaladmin is authenticated | ||
And the Yoda API for processing csv group data API is queried | ||
And the Yoda API for processing csv group data API is queried for data "csvtestgroup" | ||
Then the response status code is "200" | ||
And user "[email protected]" is now a member of the group "research-csvtestgroup" | ||
And user "[email protected]" is now a member of the group "research-csvtestgroup" | ||
|
@@ -168,6 +168,24 @@ Feature: Group API | |
And user "[email protected]" is now a member of the group "research-csvtestgroup" | ||
|
||
|
||
Scenario Outline: Group import CSV schema id and expiration date | ||
Given user technicaladmin is authenticated | ||
And the Yoda API for processing csv group data API is queried for data "csvtestgroup1" | ||
Then the response status code is "200" | ||
And user "[email protected]" is now a member of the group "research-csvtestgroup1" | ||
|
||
|
||
Scenario Outline: Group import CSV errors | ||
Given user technicaladmin is authenticated | ||
And the Yoda API for processing csv group data API is queried for data "<group_name>" | ||
Then the response status code is "400" | ||
|
||
Examples: | ||
| group_name | | ||
| csv-missing-header | | ||
| csv-missing-entry | | ||
|
||
|
||
Scenario Outline: Group delete | ||
Given user <user> is authenticated | ||
And the group "<group_name>" exists | ||
|
@@ -182,6 +200,7 @@ Feature: Group API | |
| functionaladminpriv | research-api-test1-group | | ||
| technicaladmin | datamanager-api-test1 | | ||
| technicaladmin | research-csvtestgroup | | ||
| technicaladmin | research-csvtestgroup1 | | ||
| technicaladmin | not-a-yoda-group | | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -76,10 +76,12 @@ Feature: Group UI | |
Given user functionaladminpriv is logged in | ||
And module "group_manager" is shown | ||
When user opens group import dialog | ||
And user clicks upload button | ||
And user clicks allow updates checkbox | ||
And user clicks upload button and uploads csv "csv-import-test.csv" | ||
Then there are 4 groups presented | ||
When user clicks allow updates checkbox | ||
And user clicks allow deletions checkbox | ||
Then process csv and check number of rows | ||
Then process csv | ||
And check number of rows is 4 | ||
And click on imported row 0 and check group properties | ||
And find group member "[email protected]" | ||
And user opens group import dialog | ||
|
@@ -93,6 +95,26 @@ Feature: Group UI | |
And find group member "[email protected]" | ||
|
||
|
||
Scenario: Imports group CSV schema id and expiration date | ||
Given user functionaladminpriv is logged in | ||
And module "group_manager" is shown | ||
When user opens group import dialog | ||
And user clicks upload button and uploads csv "csv-import-test-exp-schema.csv" | ||
Then there are 2 groups presented | ||
When user clicks allow updates checkbox | ||
And user clicks allow deletions checkbox | ||
Then process csv | ||
And check number of rows is 2 | ||
And click on imported row 0 and check group properties | ||
And find group member "[email protected]" | ||
And find group member "[email protected]" | ||
And user opens group import dialog | ||
And click on imported row 1 and check group properties | ||
And schema id is "default-3" | ||
And expiration date is "2027-01-01" | ||
And find group member "[email protected]" | ||
|
||
|
||
Scenario Outline: Group research create with default schema id | ||
Given user <user> is logged in | ||
And module "group_manager" is shown | ||
|
@@ -192,6 +214,8 @@ Feature: Group UI | |
| functionaladminpriv | test-automation | csv-test | research-csv-test-group2 | | ||
| functionaladminpriv | test-automation | csv-test | research-csv-test-group3 | | ||
| functionaladminpriv | test-automation | csv-test | research-csv-test-group4 | | ||
| functionaladminpriv | test-automation | csv-test | research-csv-test-group5 | | ||
| functionaladminpriv | test-automation | csv-test | research-csv-test-group6 | | ||
| functionaladminpriv | test-datamanager | test-datamanager | datamanager-test-datamanager | | ||
| functionaladminpriv | test-datamanager | test-datamanager | research-test-datamanager | | ||
| technicaladmin | test-datamanager1 | test-datamanager1 | datamanager-test-datamanager1 | | ||
|
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,3 @@ | ||
category,subcategory,groupname,manager,member,schema_id,expiration_date | ||
test-automation,csv-test,csv-test-group5,[email protected],[email protected],, | ||
test-automation,csv-test,csv-test-group6,[email protected],,default-3,2027-01-01 |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
category,subcategory,groupname,manager:manager,member:member1,member:member2,viewer:viewer1 | ||
category,subcategory,groupname,manager,member,member,viewer | ||
test-automation,csv-test,csv-test-group1,[email protected],[email protected],[email protected],[email protected] | ||
test-automation,csv-test,csv-test-group2,[email protected],[email protected],[email protected],[email protected] | ||
test-automation,csv-test,csv-test-group3,[email protected],[email protected],[email protected],[email protected] | ||
|
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 |
---|---|---|
|
@@ -294,13 +294,18 @@ def then_user_update_persisted(user, new_user, group_name): | |
assert role == "manager" | ||
|
||
|
||
@given('the Yoda API for processing csv group data API is queried', target_fixture="api_response") | ||
def api_group_import_csv_data(user): | ||
header_and_data = "category,subcategory,groupname,manager:manager,member:member1,member:member2,viewer:viewer1,member:member3\rdefault-2,default-2,csvtestgroup,[email protected],[email protected],[email protected],[email protected],[email protected]" | ||
@given(parsers.parse('the Yoda API for processing csv group data API is queried for data "{data_id}"'), target_fixture="api_response") | ||
def api_group_import_csv_data(user, data_id): | ||
headers_and_data = { | ||
"csvtestgroup": "category,subcategory,groupname,manager,member,member,viewer,member\rdefault-2,default-2,csvtestgroup,[email protected],[email protected],[email protected],[email protected],[email protected]", | ||
"csvtestgroup1": "category,subcategory,groupname,manager,expiration_date,schema_id\rdefault-2,default-2,csvtestgroup1,[email protected],2030-01-01,default-2", | ||
"csv-missing-header": "category,,groupname,manager,expiration_date,schema_id\rdefault-2,default-2,csvtestgroup1,[email protected]", | ||
"csv-missing-entry": "category,subcategory,groupname,manager,expiration_date,schema_id\rdefault-2,,csvtestgroup1,[email protected]", | ||
} | ||
return api_request( | ||
user, | ||
"group_process_csv", | ||
{"csv_header_and_data": header_and_data, | ||
{"csv_header_and_data": headers_and_data[data_id], | ||
"allow_update": True, | ||
"delete_users": True} | ||
) |
Oops, something went wrong.