From cfb190fb68a51b929b1da39ea73e35e0ffa45f6a Mon Sep 17 00:00:00 2001 From: Sarah McClelland <82645022+saram7619@users.noreply.github.com> Date: Mon, 4 Dec 2023 22:15:55 +0000 Subject: [PATCH] wrote an e2e test for can create a notebook object (#7236) * wrote an e2e test for can create a notebook object * made suggested changes to notebook.e2e.spec.js * made suggested changes to notebook.e2e.spec.js * made changes to newly created notebook --------- Co-authored-by: Jesse Mazzella --- .../plugins/notebook/notebook.e2e.spec.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js b/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js index 81e858a88d..354b2e7258 100644 --- a/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js +++ b/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js @@ -32,12 +32,25 @@ const path = require('path'); const NOTEBOOK_NAME = 'Notebook'; test.describe('Notebook CRUD Operations', () => { - test.fixme('Can create a Notebook Object', async ({ page }) => { + test.beforeEach(async ({ page }) => { + //Navigate to baseURL + await page.goto('./', { waitUntil: 'domcontentloaded' }); + }); + test('Can create a Notebook Object', async ({ page }) => { //Create domain object + await createDomainObjectWithDefaults(page, { + type: NOTEBOOK_NAME + }); //Newly created notebook should have one Section and one page, 'Unnamed Section'/'Unnamed Page' + const notebookSectionNames = page.locator('.c-notebook__sections .c-list__item__name'); + const notebookPageNames = page.locator('.c-notebook__pages .c-list__item__name'); + await expect(notebookSectionNames).toBeHidden(); + await expect(notebookPageNames).toBeHidden(); + await expect(notebookSectionNames).toHaveText('Unnamed Section'); + await expect(notebookPageNames).toHaveText('Unnamed Page'); }); test.fixme('Can update a Notebook Object', async ({ page }) => {}); - test.fixme('Can view a perviously created Notebook Object', async ({ page }) => {}); + test.fixme('Can view a previously created Notebook Object', async ({ page }) => {}); test.fixme('Can Delete a Notebook Object', async ({ page }) => { // Other than non-persistable objects });