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

End to End tests #157

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

End to End tests #157

wants to merge 2 commits into from

Conversation

tkomarlu
Copy link
Contributor

@tkomarlu tkomarlu commented Jun 5, 2020

This PR adds end-to-end testing with selenium and a mock oauth provider. We also have additional seed data so that we can mock the login flow for an admin user. This PR also adds/modifies some ids for html elements to make them easier to find with Selenium tests

src/main/resources/templates/admin/create.html Outdated Show resolved Hide resolved
src/main/resources/templates/admin/form.html Outdated Show resolved Hide resolved
Copy link
Collaborator

@pconrad pconrad left a comment

Choose a reason for hiding this comment

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

The factoring out is optional, but the other changes are small and probably good to make before we merge.

src/main/resources/data.sql Outdated Show resolved Hide resolved
public class AdminPageEnd2EndTest {

static {
System.setProperty("spring.security.oauth2.client.provider.wiremock.authorization-uri", "http://localhost:8077/oauth/authorize");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder whether we should factor this out into a test helper class support method... basically everything in this static block...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the factoring out is optional for merging.. but still a good idea...

webDriver = new ChromeDriver(options);

// Configure mock oauth endpoints
mockOAuth2Provider.stubFor(get(urlPathEqualTo("/favicon.ico")).willReturn(notFound()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This might also be a good candidate to be factored out into some kind of test helper...

src/main/resources/templates/admin/create.html Outdated Show resolved Hide resolved
@tkomarlu
Copy link
Contributor Author

tkomarlu commented Jun 5, 2020

I need to check if both PRs work with Jacqui's changes to the DB migrations as the error in the tests at the moment is due to the migrations.

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.

None yet

4 participants