fix Failing test: X-Pack Saved Object Tagging Functional Tests.x-pack/test/saved_object_tagging/functional/tests/dashboard_integration·ts (#172395)

Fixes https://github.com/elastic/kibana/issues/160583

Test failed because combobox trying to select already selected tag. PR
fixes test by using combobox service to set element. Combobox service
includes logic to only select value when not selected.


![image](e4d04854-b147-4d88-a7e5-5a7bc5fa3f38)

```
[00:07:27]           │ debg Find.clickByCssSelector('[data-test-subj="savedObjectTagSelector"]') with timeout=10000
[00:07:27]           │ debg Find.findByCssSelector('[data-test-subj="savedObjectTagSelector"]') with timeout=10000
[00:07:27]           │ debg TestSubjects.click(tagSelectorOption-tag-1)
[00:07:27]           │ debg Find.clickByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:07:27]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:07:37]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:07:37]           │      Wait timed out after 10003ms
[00:07:38]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:07:48]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:07:48]           │      Wait timed out after 10038ms
[00:07:48]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:07:58]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:07:58]           │      Wait timed out after 10054ms
[00:07:59]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:08:09]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:08:09]           │      Wait timed out after 10013ms
[00:08:09]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:08:19]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:08:19]           │      Wait timed out after 10038ms
[00:08:20]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:08:30]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:08:30]           │      Wait timed out after 10005ms
[00:08:30]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:08:40]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:08:40]           │      Wait timed out after 10034ms
[00:08:41]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:08:51]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:08:51]           │      Wait timed out after 10037ms
[00:08:51]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:09:01]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:09:01]           │      Wait timed out after 10007ms
[00:09:02]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:09:12]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:09:12]           │      Wait timed out after 10054ms
[00:09:13]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:09:23]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:09:23]           │      Wait timed out after 10037ms
[00:09:23]           │ debg Find.findByCssSelector('[data-test-subj="tagSelectorOption-tag-1"]') with timeout=10000
[00:09:33]           │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:09:33]           │      Wait timed out after 10042ms
[00:09:34]           │ debg --- retry.try error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:09:34]           │      Wait timed out after 10042ms
[00:09:34]           │          at /var/lib/buildkite-agent/builds/kb-n2-4-spot-ee2d6153f1c6deeb/elastic/kibana-on-merge/kibana/node_modules/selenium-webdriver/lib/webdriver.js:929:17
[00:09:34]           │          at processTicksAndRejections (node:internal/process/task_queues:95:5)
[00:09:34]           │ info Taking window screenshot "/var/lib/buildkite-agent/builds/kb-n2-4-spot-ee2d6153f1c6deeb/elastic/kibana-on-merge/kibana/x-pack/test/saved_object_tagging/functional/screenshots/failure/saved objects tagging - functional tests dashboard integration creating allows t-29814279444f4d298f24b012c2e451886d9c481ab2ec65240025329c4f56ba13.png"
[00:09:34]           │ info Current URL is: http://localhost:5620/app/dashboards#/create?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-15m,to:now))
[00:09:34]           │ info Saving page source to: /var/lib/buildkite-agent/builds/kb-n2-4-spot-ee2d6153f1c6deeb/elastic/kibana-on-merge/kibana/x-pack/test/saved_object_tagging/functional/failure_debug/html/saved objects tagging - functional tests dashboard integration creating allows t-29814279444f4d298f24b012c2e451886d9c481ab2ec65240025329c4f56ba13.html
[00:09:34]           └- ✖ fail: saved objects tagging - functional tests dashboard integration creating allows to select tags for a new dashboard
[00:09:34]           │      Error: retry.try timeout: Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="tagSelectorOption-tag-1"])
[00:09:34]           │ Wait timed out after 10042ms
[00:09:34]           │     at /var/lib/buildkite-agent/builds/kb-n2-4-spot-ee2d6153f1c6deeb/elastic/kibana-on-merge/kibana/node_modules/selenium-webdriver/lib/webdriver.js:929:17
[00:09:34]           │     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[00:09:34]           │     at onFailure (retry_for_success.ts:17:9)
[00:09:34]           │     at retryForSuccess (retry_for_success.ts:59:13)
[00:09:34]           │     at RetryService.try (retry.ts:31:12)
[00:09:34]           │     at Proxy.clickByCssSelector (find.ts:417:5)
[00:09:34]           │     at TestSubjects.click (test_subjects.ts:164:5)
[00:09:34]           │     at DashboardPageObject.selectDashboardTags (dashboard_page.ts:560:7)
[00:09:34]           │     at DashboardPageObject.enterDashboardTitleAndClickSave (dashboard_page.ts:544:7)
[00:09:34]           │     at dashboard_page.ts:481:7
[00:09:34]           │     at runAttempt (retry_for_success.ts:29:15)
[00:09:34]           │     at retryForSuccess (retry_for_success.ts:68:21)
[00:09:34]           │     at RetryService.try (retry.ts:31:12)
[00:09:34]           │     at DashboardPageObject.saveDashboard (dashboard_page.ts:480:5)
[00:09:34]           │     at Context.<anonymous> (dashboard_integration.ts:87:9)
[00:09:34]           │     at Object.apply (wrap_function.js:73:16)
[00:09:34]           │       at onFailure (retry_for_success.ts:17:9)
[00:09:34]           │       at retryForSuccess (retry_for_success.ts:59:13)
[00:09:34]           │       at RetryService.try (retry.ts:31:12)
[00:09:34]           │       at DashboardPageObject.saveDashboard (dashboard_page.ts:480:5)
[00:09:34]           │       at Context.<anonymous> (dashboard_integration.ts:87:9)
[00:09:34]           │       at Object.apply (wrap_function.js:73:16)
[00:09:34]           │ 
[00:09:34]           │ 
```
This commit is contained in:
Nathan Reese 2023-12-01 15:12:57 -07:00 committed by GitHub
parent 2c4d0a38d7
commit d3a8699f65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,7 @@ interface SaveDashboardOptions {
}
export class DashboardPageObject extends FtrService {
private readonly comboBox = this.ctx.getService('comboBox');
private readonly config = this.ctx.getService('config');
private readonly log = this.ctx.getService('log');
private readonly find = this.ctx.getService('find');
@ -555,9 +556,9 @@ export class DashboardPageObject extends FtrService {
}
public async selectDashboardTags(tagNames: string[]) {
await this.testSubjects.click('savedObjectTagSelector');
const tagsComboBox = await this.testSubjects.find('savedObjectTagSelector');
for (const tagName of tagNames) {
await this.testSubjects.click(`tagSelectorOption-${tagName.replace(' ', '_')}`);
await this.comboBox.setElement(tagsComboBox, tagName);
}
await this.testSubjects.click('savedObjectTitle');
}