-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic crud frontend for clients, tags and projects
- Loading branch information
Showing
77 changed files
with
2,670 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { expect, Page } from '@playwright/test'; | ||
import { PLAYWRIGHT_BASE_URL } from '../playwright/config'; | ||
import { test } from '../playwright/fixtures'; | ||
|
||
async function goToProjectsOverview(page: Page) { | ||
await page.goto(PLAYWRIGHT_BASE_URL + '/clients'); | ||
} | ||
|
||
// Create new project via modal | ||
test('test that creating and deleting a new client via the modal works', async ({ | ||
page, | ||
}) => { | ||
const newClientName = | ||
'New Project ' + Math.floor(1 + Math.random() * 10000); | ||
await goToProjectsOverview(page); | ||
await page.getByRole('button', { name: 'Create Client' }).click(); | ||
await page.getByPlaceholder('Client Name').fill(newClientName); | ||
await Promise.all([ | ||
page.getByRole('button', { name: 'Create Client' }).nth(1).click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/clients') && | ||
response.request().method() === 'POST' && | ||
response.status() === 201 && | ||
(await response.json()).data.id !== null && | ||
(await response.json()).data.name === newClientName | ||
), | ||
]); | ||
|
||
await expect(page.getByTestId('client_table')).toContainText(newClientName); | ||
const moreButton = page.locator( | ||
"[aria-label='Actions for Client " + newClientName + "']" | ||
); | ||
moreButton.click(); | ||
const deleteButton = page.locator( | ||
"[aria-label='Delete Client " + newClientName + "']" | ||
); | ||
|
||
await Promise.all([ | ||
deleteButton.click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/clients') && | ||
response.request().method() === 'DELETE' && | ||
response.status() === 204 | ||
), | ||
]); | ||
await expect(page.getByTestId('client_table')).not.toContainText( | ||
newClientName | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { expect, Page } from '@playwright/test'; | ||
import { PLAYWRIGHT_BASE_URL } from '../playwright/config'; | ||
import { test } from '../playwright/fixtures'; | ||
|
||
async function goToProjectsOverview(page: Page) { | ||
await page.goto(PLAYWRIGHT_BASE_URL + '/projects'); | ||
} | ||
|
||
// Create new project via modal | ||
test('test that creating and deleting a new project via the modal works', async ({ | ||
page, | ||
}) => { | ||
const newProjectName = | ||
'New Project ' + Math.floor(1 + Math.random() * 10000); | ||
await goToProjectsOverview(page); | ||
await page.getByRole('button', { name: 'Create Project' }).click(); | ||
await page.getByPlaceholder('Project Name').fill(newProjectName); | ||
await Promise.all([ | ||
page.getByRole('button', { name: 'Create Project' }).nth(1).click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/projects') && | ||
response.request().method() === 'POST' && | ||
response.status() === 201 && | ||
(await response.json()).data.id !== null && | ||
(await response.json()).data.color !== null && | ||
(await response.json()).data.client_id === null && | ||
(await response.json()).data.name === newProjectName | ||
), | ||
]); | ||
|
||
await expect(page.getByTestId('project_table')).toContainText( | ||
newProjectName | ||
); | ||
const moreButton = page.locator( | ||
"[aria-label='Actions for Project " + newProjectName + "']" | ||
); | ||
moreButton.click(); | ||
const deleteButton = page.locator( | ||
"[aria-label='Delete Project " + newProjectName + "']" | ||
); | ||
|
||
await Promise.all([ | ||
deleteButton.click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/projects') && | ||
response.request().method() === 'DELETE' && | ||
response.status() === 204 | ||
), | ||
]); | ||
await expect(page.getByTestId('project_table')).not.toContainText( | ||
newProjectName | ||
); | ||
}); | ||
|
||
// Create new project with new Client | ||
|
||
// Create new project with existing Client | ||
|
||
// Delete project via More Options | ||
|
||
// Test that project task count is displayed correctly | ||
|
||
// Test that active / archive / all filter works (once implemented) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { expect, Page } from '@playwright/test'; | ||
import { PLAYWRIGHT_BASE_URL } from '../playwright/config'; | ||
import { test } from '../playwright/fixtures'; | ||
|
||
async function goToTagsOverview(page: Page) { | ||
await page.goto(PLAYWRIGHT_BASE_URL + '/tags'); | ||
} | ||
|
||
// Create new project via modal | ||
test('test that creating and deleting a new client via the modal works', async ({ | ||
page, | ||
}) => { | ||
const newTagName = 'New Tag ' + Math.floor(1 + Math.random() * 10000); | ||
await goToTagsOverview(page); | ||
await page.getByRole('button', { name: 'Create Tag' }).click(); | ||
await page.getByPlaceholder('Tag Name').fill(newTagName); | ||
await Promise.all([ | ||
page.getByRole('button', { name: 'Create Tag' }).nth(1).click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/tags') && | ||
response.request().method() === 'POST' && | ||
response.status() === 201 && | ||
(await response.json()).data.id !== null && | ||
(await response.json()).data.name === newTagName | ||
), | ||
]); | ||
|
||
await expect(page.getByTestId('tag_table')).toContainText(newTagName); | ||
const moreButton = page.locator( | ||
"[aria-label='Actions for Tag " + newTagName + "']" | ||
); | ||
moreButton.click(); | ||
const deleteButton = page.locator( | ||
"[aria-label='Delete Tag " + newTagName + "']" | ||
); | ||
|
||
await Promise.all([ | ||
deleteButton.click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/tags') && | ||
response.request().method() === 'DELETE' && | ||
response.status() === 204 | ||
), | ||
]); | ||
await expect(page.getByTestId('tag_table')).not.toContainText(newTagName); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.