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

Remove generated feature tests for AF based work types #5248

Closed
elrayle opened this issue Nov 5, 2021 · 2 comments · Fixed by #5255
Closed

Remove generated feature tests for AF based work types #5248

elrayle opened this issue Nov 5, 2021 · 2 comments · Fixed by #5255
Labels

Comments

@elrayle
Copy link
Contributor

elrayle commented Nov 5, 2021

Current Challenge

The feature spec generated when a new work type is generated using rails generate hyrax:work GenericWork fails out of the box. I've tried several things to get the test to work by comparing the Hyrax feature spec spec/features/create_work_spec.rb to the generated spec for the new work type without success.

Proposed Modification

I would like to propose that we not generate the feature tests. These seem well tested by Hyrax's feature tests. It seems like applications should be able to trust that the Hyrax feature testing process is sufficient unless they make extensive customizations. In that case, the generated feature test would also need extensive modifications to test the customizations.

Looking for others opinions on this.

@no-reply
Copy link
Contributor

no-reply commented Nov 5, 2021

it seems fine to remove this. i have a recollection of this test failing out of the box in Hydra/Samvera Camp sessions as far back as 2015/16.

as a matter of principle, i don't agree that applications shouldn't test core features. in this case, the feature in question depends directly on application-owned code (the generated model) and can easily regress due to common errors application side. this point seems academic if we can't ship a feature spec that consistently passes, though, so i'm in favor of just axing it.

elrayle added a commit that referenced this issue Nov 11, 2021
Per discussion in Issue #5248, the failing feature test generated for work types is being removed.
elrayle added a commit to samvera-labs/nurax-pre2023 that referenced this issue Nov 11, 2021
See discussion in Issue samvera/hyrax#5248 and removal of generated tests in PR samvera/hyrax#5255
elrayle added a commit to samvera-labs/nurax-pre2023 that referenced this issue Nov 11, 2021
See discussion in Issue samvera/hyrax#5248 and removal of generated tests in PR samvera/hyrax#5255
@elrayle elrayle closed this as completed Nov 29, 2021
@elrayle elrayle reopened this Nov 29, 2021
@elrayle
Copy link
Contributor Author

elrayle commented Dec 6, 2021

Information about the failure on nurax-dev...

Descriptive summary

On nurax-dev, spec/features/create_generic_work_spec.rb does not pass as generated out of the box.

Rationale

Generated tests should not require modification and should pass as generated.

Expected behavior

Running generated test spec/features/create_generic_work_spec.rb should pass.

Actual behavior

Running generated test spec/features/create_generic_work_spec.rb gets error...

Failure/Error: choose "payload_concern", option: "GenericWork"

NameError:
  uninitialized constant Selenium::WebDriver::Error::UnhandledError
./spec/features/create_generic_work_spec.rb:21:in `block (3 levels) in <top (required)>'
------------------
--- Caused by: ---
Capybara::ElementNotFound:
  Unable to find visible radio button "payload_concern" that is not disabled with value "GenericWork"
  ./spec/features/create_generic_work_spec.rb:21:in `block (3 levels) in <top (required)>'

Preliminary analysis

It is possible that this is a configuration error. I confirmed the expected gems are installed (e.g. selenium-webdriver (3.142.7)

elrayle added a commit that referenced this issue Dec 7, 2021
Issue #5248 recommended removal of the failing feature test generated for work types.  Further discussion recommended marking it pending.

Minimally, users need to uncomment some lines if they generate more than one work type.  To prevent this test from failing out-of-the-box, it is marked pending.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants