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

[RAC][Observability]: test cases for alerts pagination functional tests #112617

Merged

Conversation

mgiota
Copy link
Contributor

@mgiota mgiota commented Sep 20, 2021

Fixes #110636

I reorganized a bit observability alerts services and created a separate file for pagination as a starting point. I started moving workflow status helpers to a separate file and then got stuck a bit there and left it out (the workflowStatus provider needed to use a method (getTableCells) from another common service observability provider I created, but this didn't work). Does the proposed structure I created at least for pagination make sense?

Notes
While working on this ticket tests couldn't be run against latest Chrome. As a quick workaround I was testing it on Firefox instead by changing this line https://github.com/elastic/kibana/blob/master/x-pack/test/observability_functional/with_rac_write.config.ts#L14 to use config.firefox.js

Issue to update Driver to v94 giggio/node-chromedriver#328

@mgiota mgiota added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services Theme: rac label obsolete v7.16.0 v8.0.0 auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes labels Sep 23, 2021
@mgiota mgiota marked this pull request as ready for review September 23, 2021 12:01
@mgiota
Copy link
Contributor Author

mgiota commented Sep 23, 2021

@elasticmachine merge upstream

@mgiota mgiota self-assigned this Sep 23, 2021
Copy link
Contributor

@miltonhultgren miltonhultgren left a comment

Choose a reason for hiding this comment

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

LGTM!
Nice that you broke out the pagination parts from the provider!

I left a few nitpick comments about naming :)

export function ObservabilityAlertsPaginationProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');

const getPageSizeSelector = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: These properties seem to be sorted by which page element they are using, but it's still a flat list. Would it be helpful to group related properties in an object?

I'm thinking something like:

const pageSizeSelector = {
    get: async () => { ...
    getOrFail: async () => { ...
    getOrMissing: async () => { ...
}

That would make it faster to scan which properties exist for a particular page element. A middle ground between having many small providers while still helping with some readability.
Not sure what would be done for those that only have function.

await observability.alerts.common.setWorkflowStatusFilter('open');
});

it('Does not render page size selector', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious:

  1. Is it needed to have a separate test for the page size and pagination buttons? From a users perspective that is one and the same state, "there are no pagination controls".
  2. Within the DataGrid, I'm guessing these are added as two different components but is it needed for us to also check the next button for example?

@miltonhultgren
Copy link
Contributor

@elasticmachine merge upstream

@mgiota
Copy link
Contributor Author

mgiota commented Sep 29, 2021

@elasticmachine merge upstream

@mgiota mgiota enabled auto-merge (squash) September 29, 2021 11:51
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @mgiota

@mgiota mgiota merged commit 72097ae into elastic:master Sep 29, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Sep 29, 2021
…ts (elastic#112617)

* [RAC][Observability]: test cases for alerts pagination functional tests

* page size selector tests

* create OPEN_ALERTS_ROWS_COUNT in workdlow status tests

* add tests to check if page selector is rendered or not

* reorganize tests to visible and non visible pagination controls

* default rows per page test

* page size selector tests

* more page selector tests

* write tests for pagination controls

* move pagination tests to a new file

* remove unused variables

* reorganize observability alerts service

* undo configuration change

* fix workflow status tests after refactoring

* clean up

* pr review comments

* change variable name

* rewording pagination tests

Co-authored-by: Kibana Machine <[email protected]>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Sep 29, 2021
…ts (#112617) (#113474)

* [RAC][Observability]: test cases for alerts pagination functional tests

* page size selector tests

* create OPEN_ALERTS_ROWS_COUNT in workdlow status tests

* add tests to check if page selector is rendered or not

* reorganize tests to visible and non visible pagination controls

* default rows per page test

* page size selector tests

* more page selector tests

* write tests for pagination controls

* move pagination tests to a new file

* remove unused variables

* reorganize observability alerts service

* undo configuration change

* fix workflow status tests after refactoring

* clean up

* pr review comments

* change variable name

* rewording pagination tests

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: mgiota <[email protected]>
@mgiota mgiota deleted the 110636_functional_tests_alerts_pagination branch January 4, 2022 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services Theme: rac label obsolete v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RAC] [Observability] Create functional tests for alerts table pagination
3 participants