Skip to content

Commit

Permalink
Use moveToTestNotebook during notebooks-reporting integration suite (o…
Browse files Browse the repository at this point in the history
…pensearch-project#1250)

* Use moveToTestNotebook during reporting integration suite

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

* Move refresh logic out of movetonotebook and delete old method

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

---------

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
  • Loading branch information
Swiddis authored and LDrago27 committed May 3, 2024
1 parent efe7edf commit b73e2c4
Showing 1 changed file with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ const moveToNotebookHome = () => {
cy.visit(`${BASE_PATH}/app/observability-notebooks#/`);
};

const moveToTestNotebook = (notebookName) => {
cy.visit(`${BASE_PATH}/app/observability-notebooks#/`, {
timeout: delayTime * 3,
});
const makeTestNotebook = () => {
let notebookName = testNotebookName();

moveToNotebookHome();
cy.get('a[data-test-subj="createNotebookPrimaryBtn"]').click();
cy.get('input[data-test-subj="custom-input-modal-input"]').focus();
cy.get('input[data-test-subj="custom-input-modal-input"]').type(notebookName);
cy.get('button[data-test-subj="custom-input-modal-confirm-button"]').click();

// Force refresh the observablity index and reload page to load notebooks.
cy.request({
Expand All @@ -46,21 +50,6 @@ const moveToTestNotebook = (notebookName) => {
});
cy.reload();

cy.get('.euiTableCellContent')
.contains(notebookName, {
timeout: delayTime * 3,
})
.click();
};

const makeTestNotebook = () => {
let notebookName = testNotebookName();

moveToNotebookHome();
cy.get('a[data-test-subj="createNotebookPrimaryBtn"]').click();
cy.get('input[data-test-subj="custom-input-modal-input"]').focus();
cy.get('input[data-test-subj="custom-input-modal-input"]').type(notebookName);
cy.get('button[data-test-subj="custom-input-modal-confirm-button"]').click();
cy.get('h1[data-test-subj="notebookTitle"]')
.contains(notebookName)
.should('exist');
Expand Down Expand Up @@ -107,7 +96,6 @@ const deleteNotebook = (notebookName) => {
describe('Testing notebook actions', () => {
beforeEach(() => {
let notebookName = makeTestNotebook();
moveToTestNotebook(notebookName);
cy.wrap({ name: notebookName }).as('notebook');
});

Expand Down

0 comments on commit b73e2c4

Please sign in to comment.