Skip to content

Commit

Permalink
Update student-edit.test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedNufais5891 authored Jan 1, 2025
1 parent 1a42162 commit dcd63b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/test/student-edit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ fixture`Testing Student UI`
.page`http://localhost:4401/student`

test('Testing edit students', async t => {
await t.navigateTo("/addStudent");
await t.navigateTo("/dbinitialize");
await t.typeText("#student-id", "999999");
await t.typeText("#student-name", "Pasindu Basnayaka");
await t.typeText("#student-age", "45");
await t.typeText("#student-Hometown", "catholic");
await t.click("#student-add");
await t.click("#student-edit");

await t.navigateTo("/student");
await t.navigateTo("/dbinitialize");
await t.click("#student-edit-999999");

await t.typeText("#student-name", "Changed Student Name");
await t.typeText("#student-age", "99");
await t.typeText("#student-Hometown", "Hometown");
await t.click("#student-edit");

await t.navigateTo("/student");
await t.navigateTo("/dbinitialize");

const table = Selector('#student-table')
const rowCount = await table.find('tr').count;

let tdText = await table.find('tr').nth(rowCount - 1).innerText;
await t.expect(tdText).contains("Changed Student Name");

await t.navigateTo("/student");
await t.navigateTo("/dbinitialize");
await t.click("#student-delete-999999");
});

0 comments on commit dcd63b7

Please sign in to comment.