-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
x-pack/test/functional/page_objects/copy_saved_objects_to_space_page.ts
Outdated
Show resolved
Hide resolved
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 |
Pinging @elastic/kibana-platform (Team:Platform) |
@elasticmachine merge upstream |
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(); | ||
} | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM.
30/30 on flaky test runner https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/776/
Co-authored-by: Larry Gregory <[email protected]>
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
…ed objects to space (elastic#74907) Co-authored-by: Larry Gregory <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
…ed objects to space (elastic#74907) Co-authored-by: Larry Gregory <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
…py saved objects to space (#74907) (#75069) Co-authored-by: Larry Gregory <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
…py saved objects to space (#74907) (#75070) Co-authored-by: Larry Gregory <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
* 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) ...
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.
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.
"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 forA Dashboard
but depending on other tests which had run before it, also foundA Pie
which broke the test. The fix for this is inx-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.