Skip to content

Commit

Permalink
tests(Integration): add ods test and consolidate scenarios in an outline
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Nov 14, 2024
1 parent 0dcf949 commit 8258758
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 54 deletions.
63 changes: 9 additions & 54 deletions tests/integration/features/APIv1.feature
Original file line number Diff line number Diff line change
Expand Up @@ -187,39 +187,11 @@ Feature: APIv1
Then user deletes last created row
Then user "participant1" deletes table with keyword "Rows check"


@api1 @import
Scenario: Import csv table
Given file "/import.csv" exists for user "participant1" with following data
| Col1 | Col2 | Col3 | num | emoji | special | date | truth |
| Val1 | Val2 | Val3 | 1 | πŸ’™ | Γ„ | 2024-02-24 | false |
| great | news | here | 99 | ⚠️ | Γ– | 2016-06-01 | true |
Given table "Import test" with emoji "πŸ‘¨πŸ»β€πŸ’»" exists for user "participant1" as "base1"
When user imports file "/import.csv" into last created table
Then import results have the following data
| found_columns_count | 8 |
| created_columns_count | 8 |
| inserted_rows_count | 2 |
| errors_count | 0 |
Then table has at least following typed columns
| Col1 | text |
| Col2 | text |
| Col3 | text |
| num | number |
| emoji | text |
| special | text |
| date | datetime |
| truth | selection |
Then table contains at least following rows
| Col1 | Col2 | Col3 | num | emoji | special | date | truth |
| Val1 | Val2 | Val3 | 1 | πŸ’™ | Γ„ | 2024-02-24 | false |
| great | news | here | 99 | ⚠️ | Γ– | 2016-06-01 | true |

@api1 @import
Scenario: Import xlsx table generated by 365
Given user "participant1" uploads file "import-from-ms365.xlsx"
Scenario Outline: Import a document file
Given user "participant1" uploads file "<importfile>"
And table "Import test" with emoji "πŸ‘¨πŸ»β€πŸ’»" exists for user "participant1" as "base1"
When user imports file "/import-from-ms365.xlsx" into last created table
When user imports file "/<importfile>" into last created table
Then import results have the following data
| found_columns_count | 8 |
| created_columns_count | 8 |
Expand All @@ -239,29 +211,12 @@ Feature: APIv1
| Val1 | Val2 | Val3 | 1 | πŸ’™ | Γ„ | 2024-02-24 | false |
| great | news | here | 99 | ⚠ | Γ– | 2016-06-01 | true |

@api1 @import
Scenario: Import xlsx table generated by LibreOffice
Given user "participant1" uploads file "import-from-libreoffice.xlsx"
And table "Import test" with emoji "πŸ‘¨πŸ»β€πŸ’»" exists for user "participant1" as "base1"
When user imports file "/import-from-libreoffice.xlsx" into last created table
Then import results have the following data
| found_columns_count | 8 |
| created_columns_count | 8 |
| inserted_rows_count | 2 |
| errors_count | 0 |
Then table has at least following typed columns
| Col1 | text |
| Col2 | text |
| Col3 | text |
| num | number |
| emoji | text |
| special | text |
| date | datetime |
| truth | selection |
Then table contains at least following rows
| Col1 | Col2 | Col3 | num | emoji | special | date | truth |
| Val1 | Val2 | Val3 | 1 | πŸ’™ | Γ„ | 2024-02-24 | false |
| great | news | here | 99 | ⚠ | Γ– | 2016-06-01 | true |
Examples:
| importfile |
| import-from-libreoffice.ods |
| import-from-libreoffice.xlsx |
| import-from-ms365.xlsx |
| import-from-libreoffice.csv |

@api1
Scenario: Create, edit and delete views
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/resources/import-from-libreoffice.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Col1,Col2,Col3,num,emoji,special,date,truth
Val1,Val2,Val3,1,πŸ’™,Γ„,2024-02-24,false
great,news,here,99,⚠,Γ–,2016-06-01,true
Binary file not shown.

0 comments on commit 8258758

Please sign in to comment.