Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/unskip playwright tests 2.0 #3287

Merged
3 changes: 1 addition & 2 deletions site/gatsby-site/playwright/e2e-full/cite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ test.describe('Cite pages', () => {
await expect(page.locator('[data-cy="timeline-text-response"]')).not.toBeVisible();
});

// the incident contains reports missing images so it will never pass
test.skip('There should not be image errors (400)', async ({ page }) => {
test('There should not be image errors (400)', async ({ page }) => {
page.on('console', (msg) => {
if (msg.type() === 'error') {
expect(msg.text()).not.toContain('the server responded with a status of 400');
Expand Down
93 changes: 0 additions & 93 deletions site/gatsby-site/playwright/e2e-full/submit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,99 +625,6 @@ test.describe('The Submit form', () => {
}
);

test.skip('Should show a preliminary checks message', async ({ page }) => {
pdcp1 marked this conversation as resolved.
Show resolved Hide resolved
const relatedReports = {
byURL: {
data: {
reports: [],
},
},
byDatePublished: {
data: {
reports: [],
},
},
byAuthors: {
data: { reports: [] },
},
byIncidentId: {
data: {
incidents: [],
},
},
};

await conditionalIntercept(
page,
'**/graphql',
(req) =>
req.postDataJSON().operationName == 'ProbablyRelatedReports' &&
req.postDataJSON().variables.query?.url_in?.[0] ==
'https://www.cnn.com/2021/11/02/homes/zillow-exit-ibuying-home-business/index.html',
relatedReports.byURL,
'RelatedReportsByURL'
);

await conditionalIntercept(
page,
'**/graphql',
(req) =>
req.postDataJSON().operationName == 'ProbablyRelatedReports' &&
req.postDataJSON().variables.query?.epoch_date_published_gt == 1608346800 &&
req.postDataJSON().variables.query?.epoch_date_published_lt == 1610766000,
relatedReports.byDatePublished,
'RelatedReportsByPublishedDate'
);

await conditionalIntercept(
page,
'**/graphql',
(req) =>
req.postDataJSON().operationName == 'ProbablyRelatedReports' &&
req.postDataJSON().variables.query?.authors_in?.[0] == 'test author',
relatedReports.byAuthors,
'RelatedReportsByAuthor'
);

await conditionalIntercept(
page,
'**/graphql',
(req) => req.postDataJSON().operationName == 'FindSubmissions',
{ data: { submissions: [] } },
'findSubmissions'
);

await page.goto(url);

await waitForRequest('findSubmissions');

const values = {
url: 'https://www.cnn.com/2021/11/02/homes/zillow-exit-ibuying-home-business/index.html',
authors: 'test author',
date_published: '2021-01-02',
incident_ids: '1',
};

for (const key in values) {
if (key == 'incident_ids') {
await page.locator(`input[name="${key}"]`).fill(values[key]);
await page.waitForSelector(`[role="option"]`);
await page.locator(`[role="option"]`).first().click();
} else {
await page.locator(`input[name="${key}"]`).fill(values[key]);
}
}


await waitForRequest('RelatedReportsByAuthor')
await waitForRequest('RelatedReportsByURL')
await waitForRequest('RelatedReportsByPublishedDate')

await expect(page.locator('[data-cy="no-related-reports"]').first()).toBeVisible();

await expect(page.locator('[data-cy="result"]')).not.toBeVisible();
});

test('Should *not* show semantically related reports when the text is under 256 non-space characters', async ({ page }) => {

await page.goto(url);
Expand Down
4 changes: 3 additions & 1 deletion site/gatsby-site/playwright/e2e/discover.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ test.describe('The Discover app', () => {
await expect(modal).not.toBeVisible();
});

test.skip('Opens an archive link', async ({ page, skipOnEmptyEnvironment }) => {
test('Opens an archive link', async ({ page, skipOnEmptyEnvironment }) => {

test.slow();

await page.goto(url);

Expand Down
Loading