fix api-testing example (#24407)
This commit is contained in:
parent
e60d995e9b
commit
c7beebb40f
|
|
@ -234,7 +234,7 @@ test.afterAll(async ({ }) => {
|
||||||
await apiContext.dispose();
|
await apiContext.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('last created issue should be on the server', async ({ page, request }) => {
|
test('last created issue should be on the server', async ({ page }) => {
|
||||||
await page.goto(`https://github.com/${USER}/${REPO}/issues`);
|
await page.goto(`https://github.com/${USER}/${REPO}/issues`);
|
||||||
await page.getByText('New Issue').click();
|
await page.getByText('New Issue').click();
|
||||||
await page.getByRole('textbox', { name: 'Title' }).fill('Bug report 1');
|
await page.getByRole('textbox', { name: 'Title' }).fill('Bug report 1');
|
||||||
|
|
@ -242,7 +242,7 @@ test('last created issue should be on the server', async ({ page, request }) =>
|
||||||
await page.getByText('Submit new issue').click();
|
await page.getByText('Submit new issue').click();
|
||||||
const issueId = page.url().substr(page.url().lastIndexOf('/'));
|
const issueId = page.url().substr(page.url().lastIndexOf('/'));
|
||||||
|
|
||||||
const newIssue = await request.get(`https://api.github.com/repos/${USER}/${REPO}/issues/${issueId}`);
|
const newIssue = await apiContext.get(`https://api.github.com/repos/${USER}/${REPO}/issues/${issueId}`);
|
||||||
expect(newIssue.ok()).toBeTruthy();
|
expect(newIssue.ok()).toBeTruthy();
|
||||||
expect(newIssue.json()).toEqual(expect.objectContaining({
|
expect(newIssue.json()).toEqual(expect.objectContaining({
|
||||||
title: 'Bug report 1'
|
title: 'Bug report 1'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue