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

[functional test][saved objects] update tests for additional copy saved objects to space #74907

Merged
merged 6 commits into from
Aug 14, 2020

Conversation

LeeDr
Copy link

@LeeDr LeeDr commented Aug 12, 2020

Summary

The saved objects table has some number of "actions" for each type of saved object. If there are 1 or 2 actions they have icons directly on the row. If there are 3 or more actions applicable to the saved object a context menu is shown which opens to show the actions.

image

"Spaces" and therefore "Copy to space" isn't in OSS builds so that actions menu changes for tests running in CI vs Cloud. So OSS import_objects test has to handle both paths. Fixes: #74432

This PR also fixes an issue in an x-pack test x-pack/test/functional/apps/spaces/copy_saved_objects.ts where it was filtering saved objects for A Dashboard but depending on other tests which had run before it, also found A Pie which broke the test. The fix for this is in x-pack/test/functional/page_objects/copy_saved_objects_to_space_page.ts where, after the filtering, we get the whole table of elements and can explicitly use the actions menu by the saved object title.
await elements[objectName].menuElement?.click();
Fixes: #44575

Checklist

Delete any items that are not applicable to this PR.

@LeeDr LeeDr added Feature:Functional Testing release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v7.9.0 v8.0.0 Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Aug 12, 2020
@LeeDr LeeDr requested review from legrego and dmlemeshko August 13, 2020 18:57
@LeeDr
Copy link
Author

LeeDr commented Aug 13, 2020

10 runs of test/functional/apps/management/_import_objects·js on the Cloud flaky test runner all passed. This is the test which previously failed in #74432

@LeeDr LeeDr marked this pull request as ready for review August 14, 2020 01:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@LeeDr
Copy link
Author

LeeDr commented Aug 14, 2020

@elasticmachine merge upstream

Comment on lines 123 to 141
async clickCopyToSpaceByTitle(title: string) {
const table = keyBy(await this.getElementsInTable(), 'title');
// should we check if table size > 0 and log error if not?
if (table[title].menuElement) {
log.debug(`we found a context menu element for (${title}) so click it`);
await table[title].menuElement?.click();
// Wait for context menu to render
const menuPanel = await find.byCssSelector('.euiContextMenuPanel');
await (
await menuPanel.findByTestSubject('savedObjectsTableAction-copy_saved_objects_to_space')
).click();
} else {
log.debug(
`we didn't find a menu element so should be a relastionships element for (${title}) to click`
);
// or the action elements are on the row without the menu
await table[title].copySaveObjectsElement?.click();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Are we ok to have x-pack specific test constructs inside an OSS Page Object?

Copy link
Member

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

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

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@LeeDr LeeDr merged commit 5627ab3 into elastic:master Aug 14, 2020
@LeeDr LeeDr deleted the savedObjectsMenu branch August 14, 2020 17:20
LeeDr pushed a commit to LeeDr/kibana that referenced this pull request Aug 14, 2020
…ed objects to space (elastic#74907)

Co-authored-by: Larry Gregory <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
LeeDr pushed a commit to LeeDr/kibana that referenced this pull request Aug 14, 2020
…ed objects to space (elastic#74907)

Co-authored-by: Larry Gregory <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
LeeDr pushed a commit that referenced this pull request Aug 14, 2020
…py saved objects to space (#74907) (#75069)

Co-authored-by: Larry Gregory <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
LeeDr pushed a commit that referenced this pull request Aug 14, 2020
…py saved objects to space (#74907) (#75070)

Co-authored-by: Larry Gregory <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Aug 17, 2020
* master: (24 commits)
  [ML] Functional tests - skip regression and classification tests
  [Ingest Manager] fix removing ingest pipelines from elasticsearch (elastic#75092)
  move tests for placeholder indices to setup (elastic#75096)
  [jest] temporarily extend default test timeout (elastic#75118)
  [cli] remove reference to removed --optimize flag (elastic#75083)
  skip flaky suite (elastic#75044)
  Adding /etc/rc.d/init.d/functions to the init script when present to … (elastic#22985)
  [jenkins] add pipeline for hourly security solution cypress tests (elastic#75087)
  [Reporting/Flaky Test] Skip test for paging list of reports (elastic#75075)
  remove .kbn-optimizer-cache upload (elastic#75086)
  skip flaky suite (elastic#74814)
  Actions add proxy support (elastic#74289)
  [ILM] TS conversion of Edit policy components (elastic#74747)
  [Resolver] simulator tests select elements directly instead of using descendant selectors. (elastic#75058)
  [Enterprise Search] Add Workplace Search side navigation (elastic#74894)
  [Security solution] Sourcerer: Kibana index pattern selector for security views (elastic#74706)
  [Logs UI] Remove apollo deps from log link-to routes (elastic#74502)
  [Maps] add map configurations to docker list (elastic#75035)
  [functional test][saved objects] update tests for additional copy saved objects to space (elastic#74907)
  Make the alerts plugin support generics (elastic#72716)
  ...
jportner added a commit that referenced this pull request Aug 19, 2020
These were unskipped in #74907, but the copy-to-space flyout has
changed. Updated the tests to use new test subject selectors, and
also updated some of the i18n keys to be more consistent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment