Skip to content

Commit

Permalink
[DOCS] Automate screenshot for Amazon bedrock connector (elastic#169463)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Oct 23, 2023
1 parent c2e4d40 commit f5d7c86
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/management/connectors/action-types/bedrock.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The {bedrock} connector uses https://github.com/axios/axios[axios] to send a POS
You can create connectors in *{stack-manage-app} > {connectors-ui}*. For example:

[role="screenshot"]
// TODO: need logo before screenshot
image::management/connectors/images/bedrock-connector.png[{bedrock} connector]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

[float]
[[bedrock-connector-configuration]]
Expand All @@ -41,8 +41,8 @@ You can test connectors with the <<execute-connector-api,run connector API>> or
as you're creating or editing the connector in {kib}. For example:

[role="screenshot"]
// TODO: need logo before screenshot
image::management/connectors/images/bedrock-params.png[{bedrock} params test]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

The {bedrock} actions have the following configuration properties.

Expand Down
Binary file modified docs/management/connectors/images/bedrock-connector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/management/connectors/images/bedrock-params.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const commonScreenshots = getService('commonScreenshots');
const screenshotDirectories = ['response_ops_docs', 'stack_connectors'];
const pageObjects = getPageObjects(['common', 'header']);
const actions = getService('actions');
const testSubjects = getService('testSubjects');

describe('Amazon bedrock connector', function () {
it('Amazon bedrock connector screenshots', async () => {
await pageObjects.common.navigateToApp('connectors');
await pageObjects.header.waitUntilLoadingHasFinished();
await actions.common.openNewConnectorForm('bedrock');
await testSubjects.setValue('nameInput', 'Bedrock test connector');
await testSubjects.setValue('secrets.accessKey-input', 'testkey');
await testSubjects.setValue('secrets.secret-input', 'testsecret');
await commonScreenshots.takeScreenshot(
'bedrock-connector',
screenshotDirectories,
1920,
1200
);
await testSubjects.click('create-connector-flyout-save-test-btn');
await testSubjects.click('toastCloseButton');
await commonScreenshots.takeScreenshot('bedrock-params', screenshotDirectories);
await testSubjects.click('euiFlyoutCloseButton');
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) {
});

loadTestFile(require.resolve('./connectors'));
loadTestFile(require.resolve('./bedrock_connector'));
loadTestFile(require.resolve('./email_connector'));
loadTestFile(require.resolve('./generative_ai_connector'));
loadTestFile(require.resolve('./index_connector'));
Expand Down

0 comments on commit f5d7c86

Please sign in to comment.