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

[OE] [Connectors] Enabling connectors FTRs #203192

Merged
merged 6 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ elasticsearch:
/>
</EuiText>
<EuiSpacer />
<EuiCodeBlock language="yaml" isCopyable>
<EuiCodeBlock
language="yaml"
isCopyable
data-test-subj="serverlessSearchConnectorConnectorDetails"
>
{codeBlock}
</EuiCodeBlock>
</EuiPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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: {
Expand All @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down