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

A11y tests for saved objects management table #128417

Closed

Conversation

bhavyarm
Copy link
Contributor

Meta: #51456

A11y tests for saved objects table

@bhavyarm bhavyarm added Project:Accessibility Feature:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes test_xpack_functional auto-backport Deprecated - use backport:version if exact versions are needed v8.2.0 v8.1.2 labels Mar 23, 2022
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 13, 2022

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #42 / Kibana saved objects management page a11y tests share to space panel from actions meets a11y requirements
  • [job] [logs] FTR Configs #42 / Kibana saved objects management page a11y tests share to space panel from actions meets a11y requirements

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
savedObjectsManagement 83.7KB 83.8KB +36.0B

History

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

@bhavyarm
Copy link
Contributor Author

So this test keeps failing because I cannot click on the action menu here.

failure_screenshot

A bunch of QA folks tried to help and Spencer. At this point - we are wondering if the implementation of the table is the problem.

Thanks,
Bhavya

It either fails on share to spaces test or on copy to spaces test.

it('share to space panel from actions meets a11y requirements ', async () => {
      await testSubjects.click('euiFlyoutCloseButton');

      await testSubjects.click('euiCollapsedItemActionsButton');
      await find.byCssSelector('.euiContextMenuPanel');
      await testSubjects.click('savedObjectsTableAction-share_saved_objects_to_space');
      await retry.try(async () => {
        await a11y.testAppSnapshot();
      });
      // creating a new space from this panel
      await testSubjects.click('sts-new-space-link');
      await PageObjects.spaceSelector.clickEnterSpaceName();
      await PageObjects.spaceSelector.addSpaceName('space_a');
      await PageObjects.spaceSelector.clickSaveSpaceCreation();
      await PageObjects.settings.navigateTo();
      await PageObjects.settings.clickKibanaSavedObjects();
      await (await find.byCssSelector('[title="Type"]')).click();
      await (await find.byCssSelector('[title="data view"]')).click();
      await browser.pressKeys(browser.keys.ESCAPE);
      await find.byCssSelector('.euiContextMenuPanel');
      await retry.waitFor(
        'actions button visible',
        async () => await testSubjects.exists('euiCollapsedItemActionsButton')
      );
      await testSubjects.click('euiCollapsedItemActionsButton');
      await testSubjects.click('savedObjectsTableAction-share_saved_objects_to_space');
      await (await find.byCssSelector('[title="All spaces"]')).click();
      await testSubjects.click('sts-save-button');
      await retry.waitFor('toasts.toBeVisible', async () => (await toasts.getToastCount()) > 0);
      await toasts.dismissAllToasts();
    });

    it('copy to space panel from actions menu meets a11y requirements ', async () => {
      await find.byCssSelector('.euiContextMenuPanel');
      await retry.waitFor(
        'actions button visible',
        async () => await testSubjects.exists('euiCollapsedItemActionsButton')
      );
      await testSubjects.click('euiCollapsedItemActionsButton');
      await PageObjects.common.sleep(1000);
      await find.byCssSelector('.euiContextMenuPanel');
      await testSubjects.click('euiCollapsedItemActionsButton');
      await testSubjects.click('savedObjectsTableAction-copy_saved_objects_to_space');
      await a11y.testAppSnapshot();
    });

 info Saving page source to: /Users/bhavyarajumandya/Desktop/kibana_dev/kibana/x-pack/test/functional/failure_debug/html/Kibana saved objects management page a11y tests inspect action from actions menu-3e7857b66d7823875bec1e92966f11e7ee8b657c046abfd4b1bda1d7f83cd516.html
     └- ✖ fail: Kibana saved objects management page a11y tests inspect action from actions menu meets a11y requirements
     │      Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="cts-cancel-button"])
     │ Wait timed out after 10021ms
     │     at /Users/bhavyarajumandya/Desktop/kibana_dev/kibana/node_modules/selenium-webdriver/lib/webdriver.js:901:17
     │     at runMicrotasks (<anonymous>)
     │     at processTicksAndRejections (node:internal/process/task_queues:96:5)
     │       at onFailure (/Users/bhavyarajumandya/Desktop/kibana_dev/kibana/test/common/services/retry/retry_for_success.ts:17:9)
     │       at retryForSuccess (/Users/bhavyarajumandya/Desktop/kibana_dev/kibana/test/common/services/retry/retry_for_success.ts:59:13)
     │       at RetryService.try (/Users/bhavyarajumandya/Desktop/kibana_dev/kibana/test/common/services/retry/retry.ts:31:12)
     │       at Proxy.clickByCssSelector (/Users/bhavyarajumandya/Desktop/kibana_dev/kibana/test/functional/services/common/find.ts:368:5)
     │       at TestSubjects.click (/Users/bhavyarajumandya/Desktop/kibana_dev/kibana/test/functional/services/common/test_subjects.ts:104:5)
     │       at Context.<anonymous> (test/accessibility/apps/saved_objects.ts:139:7)
     │       at Object.apply (/Users/bhavyarajumandya/Desktop/kibana_dev/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
     │ 
     │ 

@bhavyarm
Copy link
Contributor Author

cc @jportner @1Copenut help please? Thanks!

@jportner jportner self-requested a review June 16, 2022 16:37
@jportner
Copy link
Contributor

Bhavya, you're describing a problem with the "Copy to space" test. CI, on the other hand, is describing a problem with the "Share to space" test.

I tried to pull this down and it failed on the "Relationships" test, then "Share to space" and "Copy to space" after that:

image

It looks like the root cause of that problem is that it's not closing the Type filter panel, so it can't click the Actions (...) button, therefore the Actions panel is not displayed and there is no Relationships button on the page.
But overall this is different results than what you're getting.

I'm not sure how to help here.

@bhavyarm
Copy link
Contributor Author

@jportner thank you. Yeah it either fails in copy to space or share to space. Tried different things to close type filter panel and move the focus away. Still fails.

@jportner
Copy link
Contributor

You might want to try using the SavedObjectsPageObject helper class:

https://github.com/elastic/kibana/blob/main/test/functional/page_objects/management/saved_objects_page.ts

It has helper functions to interact with relationships and copy to space using the object title, which would be less brittle than your current test (that assumes only one data view is displayed in the table)

@bhavyarm
Copy link
Contributor Author

@jportner thanks. Will try it again. I remember running into an issue with a11y test design and the page objects. Will keep you posted. Thanks!

@jportner jportner removed their request for review June 28, 2022 13:56
@jportner
Copy link
Contributor

Just tying up loose ends -- if you need another review in the future please tag @elastic/kibana-security, thanks!

@legrego legrego closed this Jul 17, 2024
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 Feature:Saved Objects Management Project:Accessibility release_note:skip Skip the PR/issue when compiling release notes test_xpack_functional v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants