|
8 | 8 | import expect from '@kbn/expect'; |
9 | 9 | import { FtrProviderContext } from '../../ftr_provider_context'; |
10 | 10 | import { createAndLoginUserWithCustomRole, deleteAndLogoutUser } from './helpers'; |
11 | | -import { interceptRequest } from '../../common/intercept_request'; |
12 | 11 |
|
13 | 12 | export default function ({ getPageObjects, getService }: FtrProviderContext) { |
14 | 13 | const PageObjects = getPageObjects(['common', 'error', 'navigationalSearch', 'security']); |
15 | 14 | const ui = getService('observabilityAIAssistantUI'); |
16 | 15 | const testSubjects = getService('testSubjects'); |
17 | | - const retry = getService('retry'); |
18 | | - const toasts = getService('toasts'); |
19 | | - const driver = getService('__webdriver__'); |
20 | 16 |
|
21 | | - // Failing: See https://github.com/elastic/kibana/issues/191707 |
22 | | - describe.skip('ai assistant management privileges', () => { |
| 17 | + describe('ai assistant management privileges', () => { |
23 | 18 | describe('all privileges', () => { |
24 | 19 | before(async () => { |
25 | 20 | await createAndLoginUserWithCustomRole(getPageObjects, getService, { |
@@ -61,70 +56,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { |
61 | 56 | }); |
62 | 57 | await testSubjects.existOrFail(ui.pages.settings.settingsPage); |
63 | 58 | }); |
64 | | - it('allows updating of an advanced setting', async () => { |
65 | | - await PageObjects.common.navigateToUrl('obsAIAssistantManagement', '', { |
66 | | - ensureCurrentUrl: false, |
67 | | - shouldLoginIfPrompted: false, |
68 | | - shouldUseHashForSubUrl: false, |
69 | | - }); |
70 | | - const testSearchConnectorIndexPattern = 'my-search-index-pattern'; |
71 | | - const searchConnectorIndexPatternInput = await testSubjects.find( |
72 | | - ui.pages.settings.searchConnectorIndexPatternInput |
73 | | - ); |
74 | | - // make sure the input is empty (default value) |
75 | | - await searchConnectorIndexPatternInput.clearValue(); |
76 | | - await searchConnectorIndexPatternInput.type(testSearchConnectorIndexPattern); |
77 | | - const saveButton = await testSubjects.find(ui.pages.settings.saveButton); |
78 | | - await saveButton.click(); |
79 | | - // wait for page to refrsh |
80 | | - await testSubjects.missingOrFail(ui.pages.settings.searchConnectorIndexPatternInput, { |
81 | | - timeout: 2000, |
82 | | - }); |
83 | | - // wait for the new page to fully load |
84 | | - await testSubjects.existOrFail(ui.pages.settings.searchConnectorIndexPatternInput, { |
85 | | - timeout: 2000, |
86 | | - }); |
87 | | - expect(await searchConnectorIndexPatternInput.getAttribute('value')).to.be( |
88 | | - testSearchConnectorIndexPattern |
89 | | - ); |
90 | | - // reset the value back to default |
91 | | - const resetToDefaultLink = await testSubjects.find(ui.pages.settings.resetToDefaultLink); |
92 | | - await resetToDefaultLink.click(); |
93 | | - |
94 | | - expect(await searchConnectorIndexPatternInput.getAttribute('value')).to.be(''); |
95 | | - await saveButton.click(); |
96 | | - await testSubjects.missingOrFail(ui.pages.settings.searchConnectorIndexPatternInput, { |
97 | | - timeout: 2000, |
98 | | - }); |
99 | | - // wait for the new page to fully load |
100 | | - await testSubjects.existOrFail(ui.pages.settings.searchConnectorIndexPatternInput, { |
101 | | - timeout: 2000, |
102 | | - }); |
103 | | - expect(await searchConnectorIndexPatternInput.getAttribute('value')).to.be(''); |
104 | | - }); |
105 | | - it('displays failure toast on failed request', async () => { |
106 | | - const searchConnectorIndexPatternInput = await testSubjects.find( |
107 | | - ui.pages.settings.searchConnectorIndexPatternInput |
108 | | - ); |
109 | | - await searchConnectorIndexPatternInput.clearValue(); |
110 | | - await searchConnectorIndexPatternInput.type('test'); |
111 | | - |
112 | | - await interceptRequest( |
113 | | - driver.driver, |
114 | | - '*kibana\\/settings*', |
115 | | - (responseFactory) => { |
116 | | - return responseFactory.fail(); |
117 | | - }, |
118 | | - async () => { |
119 | | - await testSubjects.click(ui.pages.settings.saveButton); |
120 | | - } |
121 | | - ); |
122 | | - |
123 | | - await retry.waitFor('Error saving settings toast', async () => { |
124 | | - const count = await toasts.getCount(); |
125 | | - return count > 0; |
126 | | - }); |
127 | | - }); |
128 | 59 | }); |
129 | 60 | describe('with advancedSettings read privilege', () => { |
130 | 61 | before(async () => { |
|
0 commit comments