This works in all relevant browsers: document.activeElement You can use this in your Selenium steps, for example, to assert that...
I think this pattern is really useful not just for upgrading suites from Webrat, but really anywhere you have an...
...from the view back to the code that grants or denies access. You can test authorization without duplicating every feature spec for every role. You can discuss the structural choices...
...that says what a user may see and do, usable in controllers, views and tests 📄 assignable_values README — restrict an attribute to the values a user may pick, and validate...
...might look as follows: shared: &shared email: info@example.com google_analytics: container: UA-123456-12 test: <<: *shared development: <<: *shared production: <<: *shared email: production@example.com Keys under the shared namespace are shared between...
...do not need a code review, but use the merge request to run a test pipeline: # Push branch, create a merge request, set the branch to be removed on merge...
...and set to merge when all tests are green ptm = push -u origin HEAD -o merge_request.create -o merge_request.merge_when_pipeline_succeeds -o merge_request.remove_source_branch Miscellaneous [core] editor = vim # Set...
For years we copied the patiently helpers into our test suites. they now live in their own gem (makandra/patiently) where we can test them and distribute changes. Setup
When you roll custom URLs with hacks like routing-filter, you can put a spec like this into spec/routing/routing_spec.rb:
...so extend them instead of rebuilding them. You can use accessible markup to make tests more robust, e.g. by matching elements by their accessible name or aria-label. Resources
...by role and accessible name in feature specs; also shows why accessible markup makes tests more robust 📄 Orca screen reader documentation — for the exercise on Linux Exercises Use MovieDB with...
...want to define a global matcher since you need it only for your specific test, there are two ways to do it: Custom matcher for a single group
Then ... Workarounds like this do not work reliably, will result in flickering tests and should be avoided. There is no known reliable way to detect if the browser...
Interesting talk about a team that integrated automated security testing into their BDD workflow. There is also a video of the talk...
...go fixtureless with Shoulda + Factory Girl. All good, except one problem. Slow as fuck tests. So here’s fast_context as a solution for it. fast_context compiles all the...
...should’s within a context into a single test...
...the middle of config/application.rb: require 'middleware/secure_cookies' config.middleware.insert_after ActionDispatch::Static, Middleware::SecureCookies Add a test to spec/requests/secure_cookies_spec.rb: describe Middleware::SecureCookies do it 'flags all cookies sent by the application as...
get 'https://www.example.com/test/set_cookie' response.headers['Set-Cookie'].should =~ %r(test=\S+; path=/; Secure$) end it 'will not flag cookies as secure when HTTPS is not being used (in...
...directly on GitLab, or by checking out the corresponding branch. You can assume that tests are green, but you need to confirm that everything requested in the issue is implemented...
...test coverage is good the code is maintainable What to do if the code is okay If the code is okay, you may either merge it into main yourself:
...data and validate it against your own records before acting on it. You can test LLM-calling code without hitting the API in your test suite, using the techniques from...
Als DevOps Engineer kann es häufiger vorkommen, dass du ein lokales Testsetup bauen musst, um eine bestimmte Software oder ein Tool zu testen. Dafür bieten sich VMs oder Linux Container...
...dein Notebook mit vorkonfigurierten Firewall-Regeln ausgestattet ist. Starte einen (oder mehrere Container) und teste, wie du dich auf der Shell Ebene zu diesen verbinden kannst. Stelle sicher, dass deine...
The idea is this: you take a job that you'd rather not do manually, and describe it to babushka...
...build pipeline bundles it. You can evaluate a library before adding it — maintenance, popularity, tests, dependencies, size — and prefer boring technology over the newest option. You can explain why the...
...keep maintaining the library if the original author stops doing so. Does it contain tests? The code quality of our libraries should generally be around the same level of our...
...expressions extract structured data from text. This lesson teaches you to write, read and test them, and shows where they are the right tool and where they aren't.
...pattern readable, e.g. with the /x flag, comments or nested sub-patterns. You can test a pattern interactively, and you know that line breaks and multiline matching behave differently across...
...Binding URL with the LogoutResponse. Keycloak does this when Front channel logout is disabled. Testing in development using a local keycloak server You can test this using a local keycloak...
...and is enabled per default This just worked for me, so no troubleshooting here Testing in development using a local keycloak server You can test this using a local keycloak...
The argument that using tests is a ideologic waster of time fails when one considers how it can help to insure architectural decisions...
I brought up the question whether tests should call the translation API when checking for the presence of a string...
Unit tests are to refactoring like a drop cloth is to painting. Both feel like more work at first but ultimately save you time by allowing you to move faster...
...no way to do it in Capybara, unfortunately. But if you're running your tests with the Selenium driver (and probably other drivers that support JavaScript), you can hack it