Skip to content

Commit

Permalink
Merge pull request #32 from hawariMuflihMunte/testing
Browse files Browse the repository at this point in the history
End-to-End Testing
  • Loading branch information
hawariMuflihMunte authored Jun 17, 2023
2 parents db0e677 + fbd5657 commit 4f35060
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions e2e/Task_CRUD.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -166,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');
Expand All @@ -181,6 +185,33 @@ 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()));
});

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');
Expand Down

1 comment on commit 4f35060

@vercel
Copy link

@vercel vercel bot commented on 4f35060 Jun 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.