Skip to content

Commit

Permalink
[Onboarding] fix skipped api key tests (elastic#195911)
Browse files Browse the repository at this point in the history
## Summary

Failing due to api keys could not be generated as keys were created
previously and were purged in session. Fix is to move the deletion to
run at beforeEach rather than the start.

- [ ] [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
joemcelroy and elasticmachine authored Oct 16, 2024
1 parent 6438520 commit 708bf08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
describe('developer', function () {
before(async () => {
await pageObjects.svlCommonPage.loginWithRole('developer');
await pageObjects.svlApiKeys.deleteAPIKeys();
});
after(async () => {
await deleteAllTestIndices();
});
beforeEach(async () => {
await deleteAllTestIndices();
await pageObjects.svlApiKeys.deleteAPIKeys();
await svlSearchNavigation.navigateToElasticsearchStartPage();
});

Expand Down Expand Up @@ -92,8 +92,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await pageObjects.svlSearchElasticsearchStartPage.expectCreateIndexUIView();
});

// Failing: See https://github.com/elastic/kibana/issues/194673
it.skip('should show the api key in code view', async () => {
it('should show the api key in code view', async () => {
await pageObjects.svlSearchElasticsearchStartPage.expectToBeOnStartPage();
await pageObjects.svlSearchElasticsearchStartPage.clickCodeViewButton();
await pageObjects.svlApiKeys.expectAPIKeyAvailable();
Expand Down Expand Up @@ -131,8 +130,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await pageObjects.svlApiKeys.expectAPIKeyAvailable();
});

// Failing: See https://github.com/elastic/kibana/issues/194673
it.skip('Same API Key should be present on start page and index detail view', async () => {
it('Same API Key should be present on start page and index detail view', async () => {
await pageObjects.svlSearchElasticsearchStartPage.clickCodeViewButton();
await pageObjects.svlApiKeys.expectAPIKeyAvailable();
const apiKeyUI = await pageObjects.svlApiKeys.getAPIKeyFromUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await pageObjects.svlSearchIndexDetailPage.expectConnectionDetails();
});

it('should show api key', async () => {
await pageObjects.svlApiKeys.deleteAPIKeys();
await svlSearchNavigation.navigateToIndexDetailPage(indexName);
await pageObjects.svlApiKeys.expectAPIKeyAvailable();
const apiKey = await pageObjects.svlApiKeys.getAPIKeyFromUI();
await pageObjects.svlSearchIndexDetailPage.expectAPIKeyToBeVisibleInCodeBlock(apiKey);
});

it('should have quick stats', async () => {
await pageObjects.svlSearchIndexDetailPage.expectQuickStats();
await pageObjects.svlSearchIndexDetailPage.expectQuickStatsAIMappings();
Expand Down Expand Up @@ -89,13 +97,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await pageObjects.embeddedConsole.clickEmbeddedConsoleControlBar();
});

// Failing: See https://github.com/elastic/kibana/issues/194673
it.skip('should show api key', async () => {
await pageObjects.svlApiKeys.expectAPIKeyAvailable();
const apiKey = await pageObjects.svlApiKeys.getAPIKeyFromUI();
await pageObjects.svlSearchIndexDetailPage.expectAPIKeyToBeVisibleInCodeBlock(apiKey);
});

describe('With data', () => {
before(async () => {
await es.index({
Expand Down

0 comments on commit 708bf08

Please sign in to comment.