Skip to content

Commit

Permalink
testing cypress change again
Browse files Browse the repository at this point in the history
Signed-off-by: Eric <[email protected]>
  • Loading branch information
mengweieric committed Dec 14, 2023
1 parent f9519e7 commit 3052873
Show file tree
Hide file tree
Showing 10 changed files with 658 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .cypress/integration/app_analytics_test/app_analytics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ describe('Creating application', () => {
beforeEach(() => {
moveToCreatePage();
});



const testing;

it('Suggests correct autocompletion', () => {
cy.get('[data-test-subj="logSourceAccordion"]').trigger('mouseover').click();
Expand Down
599 changes: 599 additions & 0 deletions .cypress/integration/app_analytics_test/try_adding_new_file.spec.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,16 @@ describe('Open flyout for a data row to see details', () => {
querySearch(TEST_QUERIES[0].query, TEST_QUERIES[0].dateRangeDOM);
});

it('Should be able to open flyout and see data, json and traces', () => {

Check failure on line 85 in .cypress/integration/event_analytics_test/event_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Replace `⏎⏎⏎··it('Should·be·able·to·open·flyout·and·see·data,·json·and·traces',·⏎·········` with `··it('Should·be·able·to·open·flyout·and·see·data,·json·and·traces',`


it('Should be able to open flyout and see data, json and traces',
() => {
cy.get('[data-test-subj="eventExplorer__flyoutArrow"]').first().click();
cy.get('.observability-flyout').should('exist');
cy.get('.observability-flyout .osdDocViewer .euiTabs span.euiTab__content')
.contains('Table')
.should('be.visible');
cy.get('.observability-flyout .osdDocViewer .euiTabs span.euiTab__content')
.contains('JSON')
.should('be.visible');
cy.get('.observability-flyout .osdDocViewer .euiTabs span.euiTab__content')
.contains('Traces')
cy.get('.observability-flyout .osdDocViewer .euiTabs span.euiTab__content').contains('Table').should('be.visible');

Check failure on line 92 in .cypress/integration/event_analytics_test/event_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Replace `.contains('Table')` with `⏎······.contains('Table')⏎······`
cy.get('.observability-flyout .osdDocViewer .euiTabs span.euiTab__content').contains('JSON').should('be.visible');
cy.get('.observability-flyout .osdDocViewer .euiTabs span.euiTab__content').contains('Traces')
.should('be.visible');
});

Expand Down
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
/data
/build
/target
/.eslintrc.js
/cypress.config.js
!.cypress/
31 changes: 25 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,37 @@ module.exports = {
'@elastic/eslint-config-kibana',
'plugin:@elastic/eui/recommended',
'plugin:react-hooks/recommended',
"eslint:recommended",
"plugin:cypress/recommended",
"plugin:import/recommended",
"prettier"
],
env: {
'cypress/globals': true,
},
plugins: [
'cypress',
],
rules: {
'@osd/eslint/no-restricted-paths': [
'error',
{
basePath: __dirname,
zones: [
{
target: ['(public|server)/**/*'],
from: ['../../packages/**/*','packages/**/*'],
},
],
},
],
// Add cypress specific rules here
'cypress/no-assigning-return-values': 'error',
'cypress/no-unnecessary-waiting': 'error',
'cypress/assertion-before-screenshot': 'warn',
'cypress/no-force': 'warn',
'cypress/no-async-tests': 'error',
},
overrides: [
{
files: ['**/*.{js,ts,tsx}'],
Expand All @@ -32,13 +56,8 @@ module.exports = {
licenses: [LICENSE_HEADER],
},
],
// Add cypress specific rules here
'cypress/no-assigning-return-values': 'error',
'cypress/no-unnecessary-waiting': 'error',
'cypress/assertion-before-screenshot': 'warn',
'cypress/no-force': 'warn',
'cypress/no-async-tests': 'error',
},
},
],
"ignorePatterns": ["**/*.d.ts"]
};
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ jobs:
- name: lint code base
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
# Find changed JavaScript/TypeScript files in this PR
git remote -v
git fetch origin main
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB origin/main | grep -E "\.(js|ts|tsx)$")
echo "$CHANGED_FILES"
if [ -n "$CHANGED_FILES" ]; then
echo "Linting changed files..."
yarn lint $CHANGED_FILES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ import { render } from '@testing-library/react';

describe('Create Page', () => {
configure({ adapter: new Adapter() });
console.log('testing test file changes');

it('renders empty', () => {
const test;


it('renders empty', () => {
const core = coreStartMock;
const setQuery = jest.fn();
const setFilters = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import DSLService from 'public/services/requests/dsl';
describe('Log Config component', () => {
configure({ adapter: new Adapter() });

const testing;


it('renders empty log config', () => {
const core = coreStartMock;
const setQuery = jest.fn();
Expand Down
4 changes: 4 additions & 0 deletions public/components/application_analytics/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ interface HomeProps extends RouteComponentProps, AppAnalyticsCoreDeps {
parentBreadcrumbs: ChromeBreadcrumb[];
}

const testing;



export interface AppAnalyticsComponentDeps extends TraceAnalyticsComponentDeps {
name: string;
description: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const calculatOverlapArea = (bb1: BoxType, bb2: BoxType) => {
return (xRight - xLeft) * (yBottom - yTop);
};




const getTotalOverlapArea = (panelVisualizations: VisualizationType[]) => {
const newVizBox = { x1: 0, y1: 0, x2: 6, y2: 4 };
const currentVizBoxes = panelVisualizations.map((visualization) => {
Expand Down

0 comments on commit 3052873

Please sign in to comment.