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

Scraper tests #111

Merged
merged 17 commits into from
Mar 1, 2023
Merged

Scraper tests #111

merged 17 commits into from
Mar 1, 2023

Conversation

EdwardChristian
Copy link
Collaborator

Writing scraper tests for the Playwright paper scraping feature.

@EdwardChristian EdwardChristian marked this pull request as ready for review February 26, 2023 23:39
@EdwardChristian
Copy link
Collaborator Author

https://www.scrapingbee.com/webscraping-questions/playwright/how-to-load-local-files-in-playwright/

this might be a way of testing the scraping in Playwright, with jest, but it is currently extremely slow and it impedes testing..

@EdwardChristian
Copy link
Collaborator Author

Copy link
Owner

@jamesgeer jamesgeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Write test for a successful POST
  • Replace custom Prisma queries with existing methods, for example:
const insertResult = await insertPaper(myPaper);
const getResult = await getPaper(myPaper.id);
expect(insertResult.title).toEqual(getResult.title);

Instead of:

let testRes: Paper | null = await prisma.paper.findFirst({
				where: {
					source: 'acm',
				},
			});

Copy link
Owner

@jamesgeer jamesgeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gordon Ramsay Brilliant

@EdwardChristian EdwardChristian merged commit 3bcfafa into main Mar 1, 2023
@EdwardChristian EdwardChristian deleted the scraper-tests branch March 1, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants