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

Add integration test harness using Ferrum #266

Merged
merged 14 commits into from Feb 23, 2021
Merged

Add integration test harness using Ferrum #266

merged 14 commits into from Feb 23, 2021

Conversation

joelhawksley
Copy link
Contributor

@joelhawksley joelhawksley commented Feb 23, 2021

What

This PR introduces a proof-of-concept integration harness using Ferrum, leveraging ViewComponent previews to provide the example routes.

Why

In order to test javascript behaviors, we need to test our ViewComponents in integration, in a browser environment.

See #250 for more detail.

@vercel
Copy link

vercel bot commented Feb 23, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/view-components/HAhGADFp48jJaumzATDkUj5R2GwF
✅ Preview: https://view-components-git-ferrum-primer.vercel.app

@vercel vercel bot temporarily deployed to Preview February 23, 2021 16:20 Inactive
@manuelpuyol
Copy link
Contributor

@joelhawksley Does storybook and yarn build still work without webpack in demo/?

@vercel vercel bot temporarily deployed to Preview February 23, 2021 16:34 Inactive
@vercel vercel bot temporarily deployed to Preview February 23, 2021 16:36 Inactive
Comment on lines 6 to 7
"@rails/actioncable": "^6.0.0",
"@rails/ujs": "^6.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

since we are here... do we need these packages?

@vercel vercel bot temporarily deployed to Preview February 23, 2021 16:44 Inactive
@vercel vercel bot temporarily deployed to Preview February 23, 2021 16:46 Inactive
@joelhawksley
Copy link
Contributor Author

@joelhawksley Does storybook and yarn build still work without webpack in demo/?

Just checked locally, and both still work 👍🏻

@vercel vercel bot temporarily deployed to Preview February 23, 2021 16:55 Inactive
@vercel vercel bot temporarily deployed to Preview February 23, 2021 16:57 Inactive
@vercel vercel bot temporarily deployed to Preview February 23, 2021 17:04 Inactive
@vercel vercel bot temporarily deployed to Preview February 23, 2021 17:06 Inactive
@vercel vercel bot temporarily deployed to Preview February 23, 2021 17:10 Inactive
@joelhawksley joelhawksley marked this pull request as ready for review February 23, 2021 17:20
Ferrum::Browser.new(process_timeout: 5)

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :cuprite, using: :chrome, screen_size: [1400, 1400]
Copy link
Contributor

Choose a reason for hiding this comment

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

any reasoning behind 1400x1400?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, this was default from examples we saw.

def with_preview(preview_name)
component_uri = self.class.name.split("Integration").first.underscore

visit("/rails/view_components/#{component_uri}/#{preview_name}")
Copy link
Contributor

Choose a reason for hiding this comment

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

we also have the stories routes available here! wdyt of using them?
e.g: /rails/stories/primer/avatar_stack_component/avatar_stack

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting. I could go either way. I think we'll want to define specific previews for specific integration tests, but I could also see us reusing the Storybook infrastructure. Ultimately they are similar concepts that should probably share more logic than they do in this PR.

Perhaps we can land what we have here and look into this further at a later time?

@vercel vercel bot temporarily deployed to Preview February 23, 2021 17:32 Inactive
Copy link
Contributor

@manuelpuyol manuelpuyol left a comment

Choose a reason for hiding this comment

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

We can talk more about previews vs storybook later 🚢

@joelhawksley joelhawksley merged commit 0da9514 into main Feb 23, 2021
@joelhawksley joelhawksley deleted the ferrum branch February 23, 2021 17:39
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

2 participants