qa: use behat for e2e writing - #72
Draft
landsman wants to merge 3 commits into
Draft
Conversation
The old checks were 2154 lines of PHP that each booted a server, a browser and a fixture of their own, and every assertion was an if() with a hand-written message. What they proved was buried in how they proved it. The same ground is now 28 scenarios in Gherkin, run against one server and one browser with a context per scenario: 59 seconds where the old runner took three minutes, and a failure names the scenario and the step rather than a line number. The steps are named for what the user is doing, so a new scenario is usually written without touching PHP at all. Three things came over from adminer's own suite along the way, each of which was a bug here: the version cookie, which stops Adminer asking adminer.org about a new release while networkidle waits for it; disableOutput() on the server, whose unread stderr pipe fills at 64 kB and takes the app down with it mid-run; and a free-port scan, so a killed run leaves nothing behind that the next one waits on forever. The old *.test.php files stay for now — the MCP ones have not moved yet, and run.php still runs all of them.
The last four, and the ones with no browser in them: an agent borrowing this window's session, the bridge with no app behind it, the url the app records, and the daily request log. They read better as scenarios than the rest did, because what they assert is already a sentence about behaviour — a write is rolled back, a closed window is reported as one, a notification is answered with silence. The awkward part was never the Gherkin, it was that "no browser" meant a second context: McpContext drives curl and the classes directly, and both contexts now share one server through e2e_fixture() rather than booting one each.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://docs.behat.org/en/latest/