From 7052763fdcbc73217b050fc7b743049e151dec92 Mon Sep 17 00:00:00 2001 From: Ridwan Miftahul Falah Date: Fri, 16 Jun 2023 19:41:35 +0700 Subject: [PATCH 1/4] Update `Update Task` feature test case --- e2e/Task_CRUD.spec.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/e2e/Task_CRUD.spec.js b/e2e/Task_CRUD.spec.js index 1e921d4..33cc962 100644 --- a/e2e/Task_CRUD.spec.js +++ b/e2e/Task_CRUD.spec.js @@ -101,14 +101,18 @@ Scenario('Update the Task data and progress', async ({I}) => { I.clearField('input#title'); I.fillField('input#title', 'Updated Dummy Task Title'); + const subTask = locate('input[type="text"]').inside('div.form-input-column'); + + I.say('I am going to update the first Sub-Task'); + I.seeElement(subTask.first()); + I.clearField(subTask.first()); + I.fillField(subTask.first(), 'Updated Dummy Sub-Task'); + I.say('I am going to add a new Sub-Task'); I.seeElement('#addItem'); I.click('#addItem'); - const newSubTask = locate('input[type="text"]') - .inside('div.form-input-column') - .last(); - I.seeElement(newSubTask); - I.fillField(newSubTask, 'New Dummy Sub-Task'); + I.seeElement(subTask.last()); + I.fillField(subTask.last(), 'New Dummy Sub-Task'); I.say('I am going to update the Task Description'); I.seeElement('textarea#description'); From 66ba7a0e70ce0be1059c1b1546673ad6dc4a2c3d Mon Sep 17 00:00:00 2001 From: Ridwan Miftahul Falah Date: Fri, 16 Jun 2023 19:47:48 +0700 Subject: [PATCH 2/4] Update `Render Recently Updated Task` feature test case --- e2e/Task_CRUD.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/Task_CRUD.spec.js b/e2e/Task_CRUD.spec.js index 33cc962..629a5cb 100644 --- a/e2e/Task_CRUD.spec.js +++ b/e2e/Task_CRUD.spec.js @@ -170,7 +170,7 @@ Scenario('Read The Recently Updated Task and Check it`s Data Validity', async ({ const subTaskListElement = await locate('li.detail__task-list'); I.say('I am going to check if all the Sub-Tasks are valid'); - I.seeElement(locate(subTaskListElement.first()).withText(`Dummy Sub-Task`)); + I.seeElement(locate(subTaskListElement.first()).withText(`Updated Dummy Sub-Task`)); I.seeElement(locate(subTaskListElement.last()).withText(`New Dummy Sub-Task`)); I.say('I am going to check if all the Sub-Tasks completion status are valid'); From fc6184f5c7d2368496ff6db46a20ab51247c70ac Mon Sep 17 00:00:00 2001 From: Ridwan Miftahul Falah Date: Fri, 16 Jun 2023 20:05:24 +0700 Subject: [PATCH 3/4] Add `Search Task` feature test case --- e2e/Task_CRUD.spec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/e2e/Task_CRUD.spec.js b/e2e/Task_CRUD.spec.js index 629a5cb..29428fb 100644 --- a/e2e/Task_CRUD.spec.js +++ b/e2e/Task_CRUD.spec.js @@ -185,6 +185,20 @@ Scenario('Read The Recently Updated Task and Check it`s Data Validity', async ({ I.click('a[href="/#/dashboard"]'); }); +Feature('Search Task'); +Scenario('Search existing task', async ({I}) => { + I.say('I am going to search an existing task'); + I.waitForElement('input#search-bar'); + I.seeElement('input#search-bar'); + I.fillField('input#search-bar', 'Updated Dummy Task Title'); + I.click('button#search-button'); + + I.say('I expect to see a card element of the search result'); + I.waitForElement('a.card-custom'); + I.seeElement('a.card-custom'); + I.seeElement(locate('h3.card-custom__title').withText('Updated Dummy Task Title'.toUpperCase())); +}); + Feature('Delete Task'); Scenario('Delete the existing task', async ({I}) => { I.say('I expect to see the card element of a task, and then click it'); From fbd56571750230d27bc2ceb5ff88ba8e3d490936 Mon Sep 17 00:00:00 2001 From: Ridwan Miftahul Falah Date: Fri, 16 Jun 2023 20:11:38 +0700 Subject: [PATCH 4/4] Add `Search nonexisting task` scenario test case --- e2e/Task_CRUD.spec.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/e2e/Task_CRUD.spec.js b/e2e/Task_CRUD.spec.js index 29428fb..7d0c00b 100644 --- a/e2e/Task_CRUD.spec.js +++ b/e2e/Task_CRUD.spec.js @@ -187,7 +187,7 @@ Scenario('Read The Recently Updated Task and Check it`s Data Validity', async ({ Feature('Search Task'); Scenario('Search existing task', async ({I}) => { - I.say('I am going to search an existing task'); + I.say('I am going to search an existing Task'); I.waitForElement('input#search-bar'); I.seeElement('input#search-bar'); I.fillField('input#search-bar', 'Updated Dummy Task Title'); @@ -199,6 +199,19 @@ Scenario('Search existing task', async ({I}) => { I.seeElement(locate('h3.card-custom__title').withText('Updated Dummy Task Title'.toUpperCase())); }); +Scenario('Search nonexisting task', async ({I}) => { + I.waitForElement('input#search-bar'); + I.seeElement('input#search-bar'); + I.fillField('input#search-bar', 'Completely random task'); + I.click('button#search-button'); + + I.say('I expect to see a "Task Not Found" warning message modal, and then close it'); + I.waitForElement(locate('h2#swal2-title').withText('Task Not Found')); + I.seeElement(locate('h2#swal2-title').withText('Task Not Found')); + I.seeElement('button.swal2-confirm'); + I.click('button.swal2-confirm'); +}); + Feature('Delete Task'); Scenario('Delete the existing task', async ({I}) => { I.say('I expect to see the card element of a task, and then click it');