Skip to content
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
78 changes: 78 additions & 0 deletions e2e/tests/ui/features/@importer-explorer/importer-explorer.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Feature: Importer Explorer - View importers details
Background: Authentication
Given User is authenticated

Scenario: The user navigates to Importers Explorer page
Given The user navigates to TPA URL page successfully
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to avoid these extra 'navigate to homepage' generic steps. And especially repeating them in every scenario too.

  • You already have Background - Given User is authenticated (similar to existing advisory/sbom/vulnerability-explorer tests)
    -- That can be expected to result in You being already on TPA website (so have left menu available)

Also if similar step would be needed, then:

  • If all Scenarios under the Feature need such step it would be better to add it to Background instead
  • The TPA URL page - You try to navigate to Dashboard, we should in current situation avoid navigation to Dashboard unless it is relevant for the test (e.g. of dashboard itself), as currently it is very expensive page (compared to most), so if then it is better for these universal-not-related-to-test cases better to navigate elsewhere like to /upload or /importers which are way faster and do not slow test execution that much, as also do not cause that big load on the backend

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@queria @ikanias FYI, this has been addressed in this PR. If we expect the user to be authenticated, then we should already expect them to be at the /importers page, so this step is now unnecessary.

When The user selects the importers menu option
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we can expect a similar step in other scenarios, too, it would make sense to make this one re-usable, e.g. User selects the <menuOption> option and put it in a shared file in the ui/features directory.

Then Application navigates to Importers page
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a similar step here. We should make it general and re-usable and move it to a shared file in ui/features, so that we avoid redundancy.

Then Call to Action button for each importer should be visible
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this is up-to-date, anymore.


Scenario: The user can see that the filter icon appears in importers page
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scenario also checks for headers, so the scenario should probably something more general, like View the importers page and should be merged with the scenario above, as that one also only checks for general elements on the page.

Given The user navigates to TPA URL page
When The user selects the importers overview page
Then The column headers should be visible
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names of the actual headers should definitely be a part of the feature file, otherwise this step is pretty vague.

Then There should be a filter icon displayed

Scenario: The user can search a text in search text box with pressing 'Enter' in the keyboard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should be called something more general, like Search for an importer.

Given The user navigates to TPA URL landing page
When The user selects the importers option
Then A search text box appears
Then The user types "<importerName>" in the search text box and presses Enter key
Then Importer total results is 1

Examples:
| importerName |
| cve |

Scenario: The user can expand all importers to see their logs
Given The user navigates to TPA URL dashboard page
When The importers option is selected on the left menu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same step as When The user selects the importers menu option? We should reuse steps wherever possible.

Actually, now that I look at it, we have the same step in this file called by a different name in pretty much every scenario:

  • When The user selects the importers menu option
  • The user selects the importers option
  • The importers option is selected on the left menu
  • The user selects the importers overview page
  • The user selects the importers option from left menu
  • The importers option is selected on the main menu

And so on. We should think of step names as function names, because that's what they are. If you want to do the same thing multiple times, you call the same function. The step name really just calls a function described by a human readable name, otherwise it's the same thing.

Then The user expands all the importers rows
Then All the importers rows should be expanded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a step where the logs are checked to be visible should be here, too.


Scenario: Pagination controls on importer explorer page
Given The user navigates to TPA URL page home page
When The user selects the importers option from left menu
Then The importers page should be displayed with pagination and correct paging values
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be specific here about what that means.

And It should not be possible to move between pages accordingly
And It should not be possible to add page numbers in the pagination text box

Scenario: When the user clicks on the Call to Action button he can see the relevant options
Given The user navigates to TPA home page
When The importers option is selected on left menu
Then The importers page should be displayed
Then The user clicks on all the Call to Action buttons and Enable, Disable and Run options will be displayed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also outdated.



Scenario: The user is able to disable an enabled importer
Given The user navigates to TPA home landing page
When The importers option is selected on the menu
Then The importers page should be displayed properly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very vague step and should already be checked for in The user navigates to Importers Explorer page.

Then The user has clicked on the Call to Action button under an enabled importer and disables the importer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, all importers are disabled on a locally-run instance, so we probably need to add some preliminary checks and maybe we should start with enabling a disabled importer.



Scenario: The user is not able to disable an already disabled importer
Given The user navigates to TPA home dashboard page
When The importers option is selected on the main menu
Then The importers page should be displayed successfully
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again this is the same problem as above. We don't need to check for this here and we also shouldn't call for the same thing under multiple different names.

Then The user has clicked on the Call to Action icon under a disabled importer and the Disable option is not visible

Scenario: The user is able to enable a disabled importer
Given The user navigates to TPA dashboard home page
When The importers option is selected on the context menu
Then The importers page should be displayed appropreiately
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Then The user has clicked on the Kebab icon under a disabled importer and enables it
Then There should be a label of Scheduled or progress bar displayed under the specific importer

Scenario: The user can run an enabled importer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the order of scenarios should be:

  1. The user is not able to disable an already disabled importer
  2. The user is able to enable a disabled importer
  3. The user can run an enabled importer

And there probably should probably be scenarios including stopping a running importer etc.

Given The user navigates to TPA home dashboard landing page
When The importers option is selected on left context menu
Then The importers page should be displayed as designed
Then The user has clicked on the Call to Action icon under an enabled importer and then selects Run
Then There should be a confirmation message and a progress bar displayed under the relevant importer





Loading
Loading