Skip to content

Commit

Permalink
[OE] [Connectors] Enabling connectors FTRs (elastic#203192)
Browse files Browse the repository at this point in the history
## Summary

- Fixes issue where deletes all connectors before starting
- fixes issue where the first page is index_management 
- fixes devconsole tests
- fixes where the creating the connector and searching for it may not
appear (as hasn't propagated) made this test retry


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
joemcelroy and elasticmachine authored Dec 9, 2024
1 parent 1f09537 commit d51601d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
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

0 comments on commit d51601d

Please sign in to comment.