From c9cb7078e563bf1e205f99ff350c079082582703 Mon Sep 17 00:00:00 2001 From: DinkarSingh Date: Mon, 21 Sep 2020 21:52:11 +0200 Subject: [PATCH 1/2] changes --- frontend/web/tests/functionals/main.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/web/tests/functionals/main.feature b/frontend/web/tests/functionals/main.feature index cf556455..b648c27e 100644 --- a/frontend/web/tests/functionals/main.feature +++ b/frontend/web/tests/functionals/main.feature @@ -53,3 +53,5 @@ Feature: Basic use of IRMA Given I am on the previous_searched page Then I should see "eicar.com" in the search results And I should not see "hello_world.txt" in the search results + + From 116c51c3b1c81beafb267d02d173f90dad2bf7e0 Mon Sep 17 00:00:00 2001 From: DinkarSingh Date: Mon, 21 Sep 2020 22:33:03 +0200 Subject: [PATCH 2/2] Tast 2 done --- frontend/tests/eicar.com | 1 - frontend/web/tests/functionals/main.feature | 79 ++++++++++++++++++++- 2 files changed, 78 insertions(+), 2 deletions(-) delete mode 100644 frontend/tests/eicar.com diff --git a/frontend/tests/eicar.com b/frontend/tests/eicar.com deleted file mode 100644 index a2463df6..00000000 --- a/frontend/tests/eicar.com +++ /dev/null @@ -1 +0,0 @@ -X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* \ No newline at end of file diff --git a/frontend/web/tests/functionals/main.feature b/frontend/web/tests/functionals/main.feature index b648c27e..f9133a0f 100644 --- a/frontend/web/tests/functionals/main.feature +++ b/frontend/web/tests/functionals/main.feature @@ -1,11 +1,17 @@ Feature: Basic use of IRMA Scenario: As a user, I cannot launch a scan with no valid file + # According to my understanding one scenario should have one expected result (Then condition). is should not be multiple when and then in same scenario Given I am on the main page + # Since Given (Precondition) and repeatedly using in the test in that case we should write in Background: so that repetition of code can be avoid + # Here when condition is missing + # In Gherkin passing a parameter in single quote ''. Then The button "Scan for malwares" is not enabled # Allow to select the folder "/" referenced in the step # As folders are not allowed in the upload component # it will launch the upload and reject the folder + + # For good practice of gherkin language we should not use the key word I. Instead of I we can use "User can select the file name" When I select the file named "" When I wait for the upload to finish Then I should see a "danger" alert @@ -54,4 +60,75 @@ Feature: Basic use of IRMA Then I should see "eicar.com" in the search results And I should not see "hello_world.txt" in the search results - +# According to my understanding I have written the same scenarios according to me below. + + Background: + Given The user is on the main page + + Scenario: Verify button Scan for malwares is disabled + When The home page is displayed correctly + Then The button 'Scan for malwares' is 'disabled' + + Scenario: As a user, I cannot launch a scan with an invalid file + When User selects the following file + |file_name| + |file1.xls| + And Uploading file is completed + Then Danger alert is displayed + And The button 'Scan for malwares' is 'disabled' + + Scenario: Verification of single file upload + When User selects the following file + |file_name| + |file1.xls| + And Uploading file is completed + Then The button "Scan for malwares" is 'enabled' + And 1 'file is being uploaded' label is displayed + + Scenario: Verification of multiple files upload + When User selects the following file + |file_name| + |file1.xls| + |file2.xls| + And Uploading file is completed + Then The button "Scan for malwares" is 'enabled' + And 2 'file is being uploaded' label is displayed + + Scenario: As a user, I can scan a file and download the report + And User selects the following file + |file_name| + |file1.xls| + And Uploading file is completed + And The button 'Scan for malwares' is 'enabled' + And 'Scan for malwares' button is clicked + When scan status is in 'Finished' status + And 'csv' button is clicked to download the report + Then scan report is succcessfully downloaded + And 'file1.xls' is selected in the download page under file details section + And all file related informations are visible in the results page + + # `@newPage` can be used if you want to open a new tab/page + #@newPage + Scenario: As a user, I can access the search page + When User able to click on 'Search' button + Then The page title should be "IRMA | Search" + And Verify that following search results displaying + |Search Result | + |eicar.com | + |hello_world.txt| + + Scenario: As a user, when I access a result from the search page and go + back, I want to keep search information + When User type 'eicar' in the search input + And User click on 'Go!' + Then User should not see "hello_world.txt" in the search results + When User click on "eicar.com" + Then The page title should be "IRMA | Results" + When User go back + Then User should see 'eicar.com' in the search results + And User should not see 'hello_world.txt' in the search results + + Scenario: As a user, When I enter a search URL, and should be able to see + the rights results + Then User should see 'eicar.com' in the search results + And User should not see 'hello_world.txt' in the search results