Skip to content

Commit

Permalink
Rename data-test-subj and page objects
Browse files Browse the repository at this point in the history
  • Loading branch information
gbamparop committed Jan 26, 2024
1 parent 35e7325 commit 07dbbed
Show file tree
Hide file tree
Showing 39 changed files with 621 additions and 613 deletions.
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ using the CURL scripts in the scripts folder.
|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/logs_explorer/README.md[logsExplorer]
|This plugin is home to the <LogExplorer /> component and related types. It implements several of the underlying concepts that the Observability Log Explorer app builds upon.
|This plugin is home to the <LogExplorer /> component and related types. It implements several of the underlying concepts that the Observability Logs Explorer app builds upon.
|{kib-repo}blob/{branch}/x-pack/plugins/logs_shared/README.md[logsShared]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ describe('DiscoverTopNavServerless', () => {
});
});

describe('LogExplorerTabs', () => {
it('should render when showLogExplorerTabs is true', async () => {
describe('LogsExplorerTabs', () => {
it('should render when showLogsExplorerTabs is true', async () => {
mockUseKibana.mockReturnValue({
services: {
...mockDiscoverService,
Expand All @@ -148,12 +148,12 @@ describe('DiscoverTopNavServerless', () => {
const topNav = screen.queryByTestId('discoverTopNavServerless');
expect(topNav).not.toBeNull();
await waitFor(() => {
const logExplorerTabs = screen.queryByTestId('logExplorerTabs');
const logExplorerTabs = screen.queryByTestId('logsExplorerTabs');
expect(logExplorerTabs).not.toBeNull();
});
});

it('should not render when showLogExplorerTabs is false', async () => {
it('should not render when showLogsExplorerTabs is false', async () => {
mockUseKibana.mockReturnValue({
services: {
...mockDiscoverService,
Expand All @@ -169,7 +169,7 @@ describe('DiscoverTopNavServerless', () => {
const topNav = screen.queryByTestId('discoverTopNavServerless');
expect(topNav).not.toBeNull();
await waitFor(() => {
const logExplorerTabs = screen.queryByTestId('logExplorerTabs');
const logExplorerTabs = screen.queryByTestId('logsExplorerTabs');
expect(logExplorerTabs).toBeNull();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export const LogExplorerTabs = ({ services, selectedTab }: LogExplorerTabsProps)
});

return (
<EuiTabs bottomBorder={false} data-test-subj="logExplorerTabs">
<EuiTabs bottomBorder={false} data-test-subj="logsExplorerTabs">
<EuiTab
isSelected={selectedTab === 'discover'}
href={discoverUrl}
onClick={navigateToDiscover}
css={{ '.euiTab__content': { lineHeight: euiTheme.size.xxxl } }}
data-test-subj="discoverTab"
>
{i18n.translate('discover.logExplorerTabs.discover', {
{i18n.translate('discover.logsExplorerTabs.discover', {
defaultMessage: 'Discover',
})}
</EuiTab>
Expand All @@ -58,9 +58,9 @@ export const LogExplorerTabs = ({ services, selectedTab }: LogExplorerTabsProps)
href={logExplorerUrl}
onClick={navigateToLogExplorer}
css={{ '.euiTab__content': { lineHeight: euiTheme.size.xxxl } }}
data-test-subj="logExplorerTab"
data-test-subj="logsExplorerTab"
>
{i18n.translate('discover.logExplorerTabs.logExplorer', {
{i18n.translate('discover.logsExplorerTabs.logsExplorer', {
defaultMessage: 'Logs Explorer',
})}
</EuiTab>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ describe('[Logs onboarding] Custom logs - install elastic agent', () => {
.should('exist');
});

it('when user clicks on Explore Logs it navigates to observability log explorer', () => {
it('when user clicks on Explore Logs it navigates to observability logs explorer', () => {
cy.wait('@checkOnboardingProgress');
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ describe('[Logs onboarding] System logs', () => {
cy.visitKibana('/app/observabilityOnboarding/systemLogs');
});

it('when users clicks on Explore logs they navigate to log explorer - All logs', () => {
it('when users clicks on Explore logs they navigate to logs explorer - All logs', () => {
cy.wait('@systemIntegrationInstall');
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();

Expand All @@ -692,7 +692,7 @@ describe('[Logs onboarding] System logs', () => {
cy.visitKibana('/app/observabilityOnboarding/systemLogs');
});

it('when users clicks on Explore logs they navigate to log explorer and System integration is selected', () => {
it('when users clicks on Explore logs they navigate to logs explorer and System integration is selected', () => {
cy.wait('@systemIntegrationInstall');
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();

Expand Down
14 changes: 7 additions & 7 deletions x-pack/plugins/observability_solution/logs_explorer/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Log Explorer
# Logs Explorer

This plugin is home to the `<LogExplorer />` component and related types. It implements several of the underlying concepts that the [Observability Log Explorer app](../observability_solution/observability_logs_explorer) builds upon.
This plugin is home to the `<LogExplorer />` component and related types. It implements several of the underlying concepts that the [Observability Logs Explorer app](../observability_solution/observability_logs_explorer) builds upon.

## Developing the `<LogExplorer />` component

⚠ The Log Explorer is in early stages of development, so the following partly describes the current situation and partly the intended future scenario.
⚠ The Logs Explorer is in early stages of development, so the following partly describes the current situation and partly the intended future scenario.

### Dependencies

Expand All @@ -20,11 +20,11 @@ While not fully realized yet, the dependency graph would roughly resemble the fo
```mermaid
flowchart TD
obs_log_explorer_app(Observability Log Explorer app)
obs_log_explorer_app(Observability Logs Explorer app)
obs_apps(Other Observability apps)
obs_log_explorer_component(Observability Log Explorer component)
obs_log_explorer_component(Observability Logs Explorer component)
other_apps(Other non-Observability apps)
log_explorer_component(Log Explorer component)
log_explorer_component(Logs Explorer component)
platform(Kibana Platform)
discover(Discover Main container)
fleet(Fleet / EPM)
Expand All @@ -47,7 +47,7 @@ When designing the API we face two conflicting goals:
- It should be easy to consume by any non-observability app. This means...
- its API needs to be relatively stable and straightforward.
- it should not perform any page-wide changes that could interfere with consuming app's page state (such as URL changes).
- It should be extensible so the Observability Log Explorer can build on top of this.
- It should be extensible so the Observability Logs Explorer can build on top of this.

In its current state the `<LogExplorer />` achieves neither goal. To resolve the tension in the future we could export two variants with different sets of properties.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function FlyoutHeader({ doc }: { doc: FlyoutDoc }) {
<LogLevel
level={doc[constants.LOG_LEVEL_FIELD]}
renderInFlyout={true}
dataTestSubj="logExplorerFlyoutLogLevel"
dataTestSubj="logsExplorerFlyoutLogLevel"
/>
</EuiFlexItem>
</HoverActionPopover>
Expand All @@ -71,7 +71,7 @@ export function FlyoutHeader({ doc }: { doc: FlyoutDoc }) {

const contentField = hasMessageField && (
<EuiFlexItem grow={false}>
<EuiFlexGroup direction="column" gutterSize="s" data-test-subj="logExplorerFlyoutLogMessage">
<EuiFlexGroup direction="column" gutterSize="s" data-test-subj="logsExplorerFlyoutLogMessage">
<EuiFlexItem>
<EuiFlexGroup alignItems="flexEnd" gutterSize="none" justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
Expand Down Expand Up @@ -110,9 +110,9 @@ export function FlyoutHeader({ doc }: { doc: FlyoutDoc }) {
buttonContent={accordionTitle}
paddingSize="m"
initialIsOpen={true}
data-test-subj={`logExplorerFlyoutHeaderSection${flyoutContentLabel}`}
data-test-subj={`logsExplorerFlyoutHeaderSection${flyoutContentLabel}`}
>
<EuiFlexGroup direction="column" gutterSize="none" data-test-subj="logExplorerFlyoutDetail">
<EuiFlexGroup direction="column" gutterSize="none" data-test-subj="logsExplorerFlyoutDetail">
{hasMessageField ? contentField : logLevelAndTimestamp}
</EuiFlexGroup>
</EuiAccordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export function FlyoutHighlights({
<HighlightSection
title={serviceInfraAccordionTitle}
columns={columns}
data-test-subj="logExplorerFlyoutHighlightSectionServiceInfra"
data-test-subj="logsExplorerFlyoutHighlightSectionServiceInfra"
>
{formattedDoc[constants.SERVICE_NAME_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutService"
data-test-subj="logsExplorerFlyoutService"
field={constants.SERVICE_NAME_FIELD}
formattedValue={formattedDoc[constants.SERVICE_NAME_FIELD]}
label={flyoutServiceLabel}
Expand All @@ -63,7 +63,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.HOST_NAME_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutHostName"
data-test-subj="logsExplorerFlyoutHostName"
field={constants.HOST_NAME_FIELD}
formattedValue={formattedDoc[constants.HOST_NAME_FIELD]}
label={flyoutHostNameLabel}
Expand All @@ -73,7 +73,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.TRACE_ID_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutTrace"
data-test-subj="logsExplorerFlyoutTrace"
field={constants.TRACE_ID_FIELD}
formattedValue={formattedDoc[constants.TRACE_ID_FIELD]}
label={flyoutTraceLabel}
Expand All @@ -83,7 +83,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.ORCHESTRATOR_CLUSTER_NAME_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutClusterName"
data-test-subj="logsExplorerFlyoutClusterName"
field={constants.ORCHESTRATOR_CLUSTER_NAME_FIELD}
formattedValue={formattedDoc[constants.ORCHESTRATOR_CLUSTER_NAME_FIELD]}
label={flyoutOrchestratorClusterNameLabel}
Expand All @@ -93,7 +93,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.ORCHESTRATOR_RESOURCE_ID_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutResourceId"
data-test-subj="logsExplorerFlyoutResourceId"
field={constants.ORCHESTRATOR_RESOURCE_ID_FIELD}
formattedValue={formattedDoc[constants.ORCHESTRATOR_RESOURCE_ID_FIELD]}
label={flyoutOrchestratorResourceIdLabel}
Expand All @@ -106,11 +106,11 @@ export function FlyoutHighlights({
<HighlightSection
title={cloudAccordionTitle}
columns={columns}
data-test-subj="logExplorerFlyoutHighlightSectionCloud"
data-test-subj="logsExplorerFlyoutHighlightSectionCloud"
>
{formattedDoc[constants.CLOUD_PROVIDER_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutCloudProvider"
data-test-subj="logsExplorerFlyoutCloudProvider"
field={constants.CLOUD_PROVIDER_FIELD}
formattedValue={formattedDoc[constants.CLOUD_PROVIDER_FIELD]}
icon={
Expand All @@ -127,7 +127,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.CLOUD_REGION_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutCloudRegion"
data-test-subj="logsExplorerFlyoutCloudRegion"
field={constants.CLOUD_REGION_FIELD}
formattedValue={formattedDoc[constants.CLOUD_REGION_FIELD]}
label={flyoutCloudRegionLabel}
Expand All @@ -137,7 +137,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.CLOUD_AVAILABILITY_ZONE_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutCloudAz"
data-test-subj="logsExplorerFlyoutCloudAz"
field={constants.CLOUD_AVAILABILITY_ZONE_FIELD}
formattedValue={formattedDoc[constants.CLOUD_AVAILABILITY_ZONE_FIELD]}
label={flyoutCloudAvailabilityZoneLabel}
Expand All @@ -147,7 +147,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.CLOUD_PROJECT_ID_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutCloudProjectId"
data-test-subj="logsExplorerFlyoutCloudProjectId"
field={constants.CLOUD_PROJECT_ID_FIELD}
formattedValue={formattedDoc[constants.CLOUD_PROJECT_ID_FIELD]}
label={flyoutCloudProjectIdLabel}
Expand All @@ -157,7 +157,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.CLOUD_INSTANCE_ID_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutCloudInstanceId"
data-test-subj="logsExplorerFlyoutCloudInstanceId"
field={constants.CLOUD_INSTANCE_ID_FIELD}
formattedValue={formattedDoc[constants.CLOUD_INSTANCE_ID_FIELD]}
label={flyoutCloudInstanceIdLabel}
Expand All @@ -170,11 +170,11 @@ export function FlyoutHighlights({
<HighlightSection
title={otherAccordionTitle}
columns={columns}
data-test-subj="logExplorerFlyoutHighlightSectionOther"
data-test-subj="logsExplorerFlyoutHighlightSectionOther"
>
{formattedDoc[constants.LOG_FILE_PATH_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutLogPathFile"
data-test-subj="logsExplorerFlyoutLogPathFile"
field={constants.LOG_FILE_PATH_FIELD}
formattedValue={formattedDoc[constants.LOG_FILE_PATH_FIELD]}
label={flyoutLogPathFileLabel}
Expand All @@ -184,7 +184,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.DATASTREAM_DATASET_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutDataset"
data-test-subj="logsExplorerFlyoutDataset"
field={constants.DATASTREAM_DATASET_FIELD}
formattedValue={formattedDoc[constants.DATASTREAM_DATASET_FIELD]}
label={flyoutDatasetLabel}
Expand All @@ -194,7 +194,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.DATASTREAM_NAMESPACE_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutNamespace"
data-test-subj="logsExplorerFlyoutNamespace"
field={constants.DATASTREAM_NAMESPACE_FIELD}
formattedValue={formattedDoc[constants.DATASTREAM_NAMESPACE_FIELD]}
label={flyoutNamespaceLabel}
Expand All @@ -205,7 +205,7 @@ export function FlyoutHighlights({
)}
{formattedDoc[constants.AGENT_NAME_FIELD] && (
<HighlightField
data-test-subj="logExplorerFlyoutLogShipper"
data-test-subj="logsExplorerFlyoutLogShipper"
field={constants.AGENT_NAME_FIELD}
formattedValue={formattedDoc[constants.AGENT_NAME_FIELD]}
label={flyoutShipperLabel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function Timestamp({ timestamp }: TimestampProps) {
if (!timestamp) return null;

return (
<EuiBadge color="hollow" data-test-subj="logExplorerFlyoutLogTimestamp">
<EuiBadge color="hollow" data-test-subj="logsExplorerFlyoutLogTimestamp">
{timestamp}
</EuiBadge>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const LogMessage = ({ field, value }: { field?: string; value: string }) => {
return (
<EuiText size="xs" style={{ display: 'inline', marginLeft: '5px' }}>
{renderFieldPrefix && (
<strong data-test-subj="logExplorerDataTableMessageKey">{field}</strong>
<strong data-test-subj="logsExplorerDataTableMessageKey">{field}</strong>
)}
<span data-test-subj="logExplorerDataTableMessageValue" style={{ marginLeft: '5px' }}>
<span data-test-subj="logsExplorerDataTableMessageValue" style={{ marginLeft: '5px' }}>
{value}
</span>
</EuiText>
Expand Down Expand Up @@ -108,7 +108,7 @@ export const Content = ({
fieldFormats={fieldFormats}
shouldShowFieldHandler={shouldShowFieldHandler}
maxEntries={50}
dataTestSubj="logExplorerCellDescriptionList"
dataTestSubj="logsExplorerCellDescriptionList"
className="logsExplorerVirtualColumn__sourceDocument"
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const CustomFlyoutContent = ({
<>
<EuiSpacer size="m" />
<EuiFlexGroup direction="column">
{/* Apply custom Log Explorer detail */}
{/* Apply custom Logs Explorer detail */}
{renderCustomizedContent(flyoutContentProps)}
</EuiFlexGroup>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

const BASE_DATA_VIEW_TEST_SUBJ = 'logExplorerDataView';
const BASE_DATA_VIEW_TEST_SUBJ = 'logsExplorerDataView';

const publicDataViewPatternsSet = new Set(['logs-*', 'logstash-*', 'filebeat-*']);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Observability Log Explorer
# Observability Logs Explorer

This plugin provides an app based on the `LogExplorer` component from the `logs_explorer` plugin, but adds observability-specific affordances.

Expand Down Expand Up @@ -39,11 +39,11 @@ yarn test:ftr:runner --config ./x-pack/test_serverless/functional/test_suites/ob

## Checktypes

#### Log Explorer
#### Logs Explorer
```
node scripts/type_check.js --project x-pack/plugins/observability_solution/logs_explorer/tsconfig.json
```
#### Observability Log Explorer
#### Observability Logs Explorer
```
node scripts/type_check.js --project x-pack/plugins/observability_solution/observability_logs_explorer/tsconfig.json
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const DiscoverLinkForUnknownState = React.memo(() => (
<EuiHeaderLink
color="primary"
iconType="discoverApp"
data-test-subj="logExplorerDiscoverFallbackLink"
data-test-subj="logsExplorerDiscoverFallbackLink"
disabled
>
{discoverLinkTitle}
Expand Down Expand Up @@ -105,7 +105,7 @@ export const DiscoverLink = React.memo(
{...discoverLinkProps}
color="primary"
iconType="discoverApp"
data-test-subj="logExplorerDiscoverFallbackLink"
data-test-subj="logsExplorerDiscoverFallbackLink"
>
{discoverLinkTitle}
</EuiHeaderLink>
Expand Down
Loading

0 comments on commit 07dbbed

Please sign in to comment.