diff --git a/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connection_details_panel.tsx b/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connection_details_panel.tsx index 1a25b1d3c3dfa..4dc3d9db5b955 100644 --- a/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connection_details_panel.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connection_details_panel.tsx @@ -53,7 +53,11 @@ elasticsearch: /> - + {codeBlock} diff --git a/x-pack/test_serverless/functional/page_objects/svl_search_connectors_page.ts b/x-pack/test_serverless/functional/page_objects/svl_search_connectors_page.ts index 78554ea05beda..8279c89f05d03 100644 --- a/x-pack/test_serverless/functional/page_objects/svl_search_connectors_page.ts +++ b/x-pack/test_serverless/functional/page_objects/svl_search_connectors_page.ts @@ -11,7 +11,18 @@ export function SvlSearchConnectorsPageProvider({ getService }: FtrProviderConte const testSubjects = getService('testSubjects'); const browser = getService('browser'); const retry = getService('retry'); + const es = getService('es'); return { + helpers: { + async deleteAllConnectors() { + const connectors = await es.connector.list(); + for (const connector of connectors.results) { + await es.connector.delete({ + connector_id: connector.id!, + }); + } + }, + }, connectorConfigurationPage: { async createConnector() { await testSubjects.click('serverlessSearchEmptyConnectorsPromptCreateConnectorButton'); @@ -60,8 +71,8 @@ export function SvlSearchConnectorsPageProvider({ getService }: FtrProviderConte async expectConnectorIdToMatchUrl(connectorId: string) { expect(await browser.getCurrentUrl()).contain(`/app/connectors/${connectorId}`); }, - async getConnectorId() { - return await testSubjects.getVisibleText('serverlessSearchConnectorConnectorId'); + async getConnectorDetails() { + return await testSubjects.getVisibleText('serverlessSearchConnectorConnectorDetails'); }, }, connectorOverviewPage: { @@ -70,8 +81,11 @@ export function SvlSearchConnectorsPageProvider({ getService }: FtrProviderConte await testSubjects.setValue('serverlessSearchConnectorsTableSelect', option); }, async connectorNameExists(connectorName: string) { - const connectorsList = await this.getConnectorsList(); - return Boolean(connectorsList.find((name) => name === connectorName)); + await retry.tryForTime(10000, async () => { + const connectorsList = await this.getConnectorsList(); + const isFound = Boolean(connectorsList.find((name) => name === connectorName)); + expect(isFound).to.be(true); + }); }, async confirmDeleteConnectorModalComponentsExists() { await testSubjects.existOrFail('serverlessSearchDeleteConnectorModalFieldText'); diff --git a/x-pack/test_serverless/functional/test_suites/search/connectors/connectors_overview.ts b/x-pack/test_serverless/functional/test_suites/search/connectors/connectors_overview.ts index 95b35381a3d1e..7b014d6ad3e7a 100644 --- a/x-pack/test_serverless/functional/test_suites/search/connectors/connectors_overview.ts +++ b/x-pack/test_serverless/functional/test_suites/search/connectors/connectors_overview.ts @@ -18,26 +18,32 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { ]); const testSubjects = getService('testSubjects'); const browser = getService('browser'); - // FLAKY: https://github.com/elastic/kibana/issues/197019 - describe.skip('connectors', function () { + + describe('connectors', function () { before(async () => { + await pageObjects.svlSearchConnectorsPage.helpers.deleteAllConnectors(); await pageObjects.svlCommonPage.loginWithRole('developer'); - await pageObjects.svlCommonNavigation.sidenav.clickLink({ - deepLinkId: 'serverlessConnectors', - }); }); - it('Connector app is loaded and has no connectors', async () => { - await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectConnectorOverviewPageComponentsToExist(); - }); - it('has embedded dev console', async () => { + it('has embedded console', async () => { + await pageObjects.common.navigateToApp('serverlessConnectors'); await testHasEmbeddedConsole(pageObjects); }); + + it('Connector app is loaded and has no connectors', async () => { + await pageObjects.common.navigateToApp('serverlessConnectors'); + await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectConnectorOverviewPageComponentsToExist(); + }); + describe('create and configure connector', () => { it('create connector and confirm connector configuration page is loaded', async () => { await pageObjects.svlSearchConnectorsPage.connectorConfigurationPage.createConnector(); + await pageObjects.svlSearchConnectorsPage.connectorConfigurationPage.editType('zoom'); + const connectorDetails = + await pageObjects.svlSearchConnectorsPage.connectorConfigurationPage.getConnectorDetails(); + const connectorId = connectorDetails.match(/connector_id: (.*)/)?.[1]; await pageObjects.svlSearchConnectorsPage.connectorConfigurationPage.expectConnectorIdToMatchUrl( - await pageObjects.svlSearchConnectorsPage.connectorConfigurationPage.getConnectorId() + connectorId! ); }); it('edit description', async () => {