Skip to content

Commit

Permalink
fix: add timelog.utils.ts change for later CRM test of this PR's func…
Browse files Browse the repository at this point in the history
…tionality
  • Loading branch information
dragonflyfree committed May 3, 2024
1 parent 5d295e9 commit dff97d7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class TimelogHelper {
await expect(page.getByText(timelog)).toBeVisible();
}

static async createTimelog(page: Page, timelog: string, taskName: string, taskID: string, date: DateTime, start_time: string, end_time: string)
static async createTimelog(page: Page, timelog: string, taskName: string, taskID: string, date: DateTime, start_time: string, end_time: string, time_type: string = null)
{
if(page.url() != HOST + "/task/edit/" + taskID + "#details") {
if(page.url() != HOST + "/task/tasklist")
Expand All @@ -52,9 +52,12 @@ export class TimelogHelper {
await page.locator("#time_start").fill(start_time);
await page.locator("#time_end").fill(end_time);
await page.getByLabel("Description", {exact: true}).fill(timelog);
if (time_type) {
await page.getByRole("combobox", {name: 'Task time' }).selectOption({ value: time_type });
}
await page.locator("#timelog_edit_form").getByRole("button", { name: "Save" }).click();

await page.getByRole("link", {name: taskName, exact: true}).first().click();
await page.getByRole("link", {name: taskName, exact: false}).first().click();
await page.getByRole("link", {name: "Time Log"}).click();
await page.reload();
await expect(page.getByText(timelog)).toBeVisible();
Expand Down

0 comments on commit dff97d7

Please sign in to comment.