Skip to content

Commit

Permalink
Merge branch '2.x' into backport/backport-1586-to-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
saimedhi authored Oct 18, 2024
2 parents 27731c0 + 970b0f4 commit 003e010
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "25b9c01c-350d-4b95-bed1-836d04a4f325",
"id": "25b9c01c-350d-4b95-bed1-836d04a4f324",
"category": "dns",
"title": "Cypress DNS Type Rule",
"description": "Detects DNS type as QWE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,32 @@ describe('discover app', { scrollBehavior: false }, () => {

after(() => {});

describe('filters and queries', () => {
after(() => {
cy.get('[data-test-subj~="filter-key-extension.raw"]').click();
cy.getElementByTestId(`deleteFilter`).click();
cy.switchDiscoverTable('legacy');
});
it('should persist across refresh', function () {
// Set up query and filter
cy.setTopNavQuery('response:200');
cy.submitFilterFromDropDown('extension.raw', 'is one of', 'jpg');
cy.reload();
cy.getElementByTestId(`queryInput`).should('have.text', 'response:200');
cy.get('[data-test-subj~="filter-key-extension.raw"]').should(
'be.visible'
);
});

it('should persist across switching table', function () {
cy.switchDiscoverTable('new');
cy.getElementByTestId(`queryInput`).should('have.text', 'response:200');
cy.get('[data-test-subj~="filter-key-extension.raw"]').should(
'be.visible'
);
});
});

describe('save search', () => {
const saveSearch1 = 'Save Search # 1';
const saveSearch2 = 'Modified Save Search # 1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ import { CURRENT_TENANT } from '../../../utils/commands';

const miscUtils = new MiscUtils(cy);

describe('Add flights dataset saved object', () => {
before(() => {
describe('Add flights dataset saved object', function () {
before(function () {
CURRENT_TENANT.newTenant = 'global';
cy.deleteAllIndices();
miscUtils.addSampleData();
cy.wait(10000);

// Enable the new home UI
// Enable the new home UI if possible
cy.visit(`${BASE_PATH}/app/settings`);
cy.get(
'[data-test-subj="advancedSetting-editField-home:useNewHomePage"]'
).then(($switch) => {
if ($switch.attr('aria-checked') === 'false') {
if ($switch.attr('disabled') === 'disabled') {
cy.log('Switch is disabled and cannot be changed.');
this.skip(); // Skip all tests in this suite
} else if ($switch.attr('aria-checked') === 'false') {
cy.wrap($switch).click();
cy.get('[data-test-subj="advancedSetting-saveButton"]').click();
cy.get('button.euiButton--primary.euiButton--small', {
Expand All @@ -35,12 +38,14 @@ describe('Add flights dataset saved object', () => {

after(() => {
miscUtils.removeSampleData();
// Disable the new home UI
// Disable the new home UI if possible
cy.visit(`${BASE_PATH}/app/settings`);
cy.get(
'[data-test-subj="advancedSetting-editField-home:useNewHomePage"]'
).then(($switch) => {
if ($switch.attr('aria-checked') === 'true') {
if ($switch.attr('disabled') === 'disabled') {
cy.log('Switch is disabled and cannot be changed.');
} else if ($switch.attr('aria-checked') === 'true') {
cy.wrap($switch).click();
cy.get('[data-test-subj="advancedSetting-saveButton"]').click();
cy.get('button.euiButton--primary.euiButton--small', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ Cypress.Commands.add(
Cypress.log({ message: `Select combobox items: ${items.join(' | ')}` });
items.map((item) => {
cy.wrap(subject).type(item);

// Short wait to reduce flakiness
cy.wait(3000);
cy.get(`[title="${item}"]`).click({ force: true });
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch-dashboards-functional-test",
"version": "2.17.0",
"version": "2.18.0",
"description": "Maintains functional tests for OpenSearch Dashboards and Dashboards plugins",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 003e010

Please sign in to comment.