Skip to content

Commit

Permalink
Merge branch '2.16' into security-notif-test
Browse files Browse the repository at this point in the history
Signed-off-by: Riya <69919272+riysaxen-amzn@users.noreply.github.com>
  • Loading branch information
riysaxen-amzn authored Aug 3, 2024
2 parents a1868c1 + 15e4529 commit 46840a6
Show file tree
Hide file tree
Showing 21 changed files with 371 additions and 673 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"total": 26,
"data": {
"test": {
"test-selection": {
"reserved": false,
"hidden": false,
"allowed_actions": ["data_access"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"total": 26,
"data": {
"test": {
"test-creation": {
"reserved": false,
"hidden": false,
"allowed_actions": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,78 +435,78 @@ describe('discover_advanced_setting', () => {
});
});

describe('modifyColumnsOnSwitch advanced setting', () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': false,
});
});

it.skip('check columns still available after switching data sources in legacy table', function () {
miscUtils.visitPage(
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForSearch();
cy.get('[data-test-subj="fieldToggle-agent"]').click();

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.wait(300);
cy.get('[data-test-subj="docTableHeader-agent"]').should(
'be.visible'
);
cy.get('[data-test-subj="docTableField"]')
.contains('-')
.should('exist');
});
});
after(() => {});
});

/*
*/
describe('modifyColumnsOnSwitch advanced setting', () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': false,
});
});

it('check columns still available after switching data sources in new table', function () {
miscUtils.visitPage(
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForSearch();
cy.switchDiscoverTable('new');

cy.get('[data-test-subj="fieldToggle-agent"]').click();
it.skip('check columns still available after switching data sources in legacy table', function () {
miscUtils.visitPage(
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForSearch();
cy.get('[data-test-subj="fieldToggle-agent"]').click();

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.wait(300);
cy.get('[data-test-subj="docTableHeader-agent"]').should(
'be.visible'
);
cy.get('[data-test-subj="docTableField"]')
.contains('-')
.should('exist');
});
});

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.waitForSearch();
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.get('[data-test-subj="dataGridHeaderCell-agent"]').should(
'be.visible'
);
cy.get('[data-test-subj="dataGridRowCell"]')
.contains('-')
.should('exist');
});
});
});
/*
*/
});

after(() => {
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': true,
it('check columns still available after switching data sources in new table', function () {
miscUtils.visitPage(
`app/data-explorer/discover#/?_a=(discover:(metadata:(indexPattern:'logstash-*',view:discover))&_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForSearch();
cy.switchDiscoverTable('new');

cy.get('[data-test-subj="fieldToggle-agent"]').click();

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.waitForSearch();
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.get('[data-test-subj="dataGridHeaderCell-agent"]').should(
'be.visible'
);
cy.wait(2000);
cy.get('[data-test-subj="dataGridRowCell"]')
.contains('-')
.should('exist');
});
});
});
});

after(() => {
cy.deleteIndexPattern('nestedindex');
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': true,
});
cy.deleteSavedObjectByType('index-pattern');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('index pattern without field spec', () => {
testFixtureHandler.clearJSONMapping(
'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/index_pattern_without_timefield/mappings.json.txt'
);
cy.deleteSavedObjectByType('index-pattern');
});

it('should not display a timepicker', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
cy.getElementByTestId(
'euiColorPickerAnchor workspaceForm-workspaceDetails-colorPicker'
).type('#000000');
cy.getElementByTestId('workspaceUseCase-observability').check({
cy.getElementByTestId('workspaceUseCase-observability').click({
force: true,
});
cy.getElementByTestId('workspaceForm-bottomBar-createButton').click({
Expand All @@ -52,17 +52,13 @@ if (Cypress.env('WORKSPACE_ENABLED')) {

cy.location('pathname', { timeout: 6000 }).should(
'include',
'app/workspace_overview'
'app/workspace_detail'
);

const expectedWorkspace = {
name: workspaceName,
description: 'test_workspace_description.+~!',
features: [
'workspace_update',
'workspace_overview',
'use-case-observability',
],
features: ['workspace_detail', 'use-case-observability'],
};
cy.checkWorkspace(workspaceId, expectedWorkspace);
});
Expand All @@ -77,7 +73,7 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
cy.getElementByTestId('workspaceForm-bottomBar-createButton').click({
force: true,
});
cy.contains("Name can't be empty").should('exist');
cy.contains('Name is required. Enter a name.').should('exist');
});

it('workspace name is not valid', () => {
Expand All @@ -90,7 +86,7 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
cy.getElementByTestId('workspaceForm-bottomBar-createButton').click({
force: true,
});
cy.contains('Invalid workspace name').should('exist');
cy.contains('Name is invalid. Enter a valid name.').should('exist');
});

it('workspace name cannot use an existing name', () => {
Expand All @@ -100,7 +96,7 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
cy.getElementByTestId(
'workspaceForm-workspaceDetails-descriptionInputText'
).type('test_workspace_description');
cy.getElementByTestId('workspaceUseCase-observability').check({
cy.getElementByTestId('workspaceUseCase-observability').click({
force: true,
});
cy.getElementByTestId('workspaceForm-bottomBar-createButton').click({
Expand Down Expand Up @@ -139,14 +135,15 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
cy.getElementByTestId(
'euiColorPickerAnchor workspaceForm-workspaceDetails-colorPicker'
).type('#000000');
cy.getElementByTestId('workspaceUseCase-observability').check({
cy.getElementByTestId('workspaceUseCase-observability').click({
force: true,
});
cy.getElementByTestId(
'workspaceForm-permissionSettingPanel-user-addNew'
).click();
cy.getElementByTestId('comboBoxSearchInput')
.last()
cy.contains('.euiComboBoxPlaceholder', 'Select a user')
.parent()
.find('input')
.type('test_user_sfslja260');
cy.getElementByTestId('workspaceForm-bottomBar-createButton').click({
force: true,
Expand All @@ -158,16 +155,12 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
workspaceId = interception.response.body.result.id;
cy.location('pathname', { timeout: 6000 }).should(
'include',
'app/workspace_overview'
'app/workspace_detail'
);
const expectedWorkspace = {
name: workspaceName,
description: 'test_workspace_description',
features: [
'workspace_update',
'workspace_overview',
'use-case-observability',
],
features: ['workspace_detail', 'use-case-observability'],
permissions: {
read: {
users: ['test_user_sfslja260'],
Expand Down
Loading

0 comments on commit 46840a6

Please sign in to comment.