-
-
Notifications
You must be signed in to change notification settings - Fork 0
Added test for the Contact form. #26
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
Conversation
WalkthroughA new Behat feature file for testing the contact form has been added, introducing scenarios for verifying the form's accessibility, successful submission, and validation error handling. The Changes
Sequence Diagram(s)sequenceDiagram
participant Tester as Behat Tester
participant Browser as Browser Session
participant FeatureContext as FeatureContext
Tester->>FeatureContext: Given I disable browser validation for form ".selector"
FeatureContext->>Browser: Execute JS to set 'novalidate' on form
Browser-->>FeatureContext: JS Execution Result
FeatureContext-->>Tester: Step complete
sequenceDiagram
participant Tester as Behat Tester
participant Browser as Browser Session
Tester->>Browser: Visit homepage
Tester->>Browser: Click "Contact" link
Tester->>Browser: Fill contact form fields
Tester->>Browser: Submit form
Browser-->>Tester: Display success or error message
Tester->>Browser: Take screenshot
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
6e7217e to
ac4e776
Compare
ac4e776 to
e8167b3
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
| * | ||
| * @When I disable browser validation for the form with selector :selector | ||
| */ | ||
| public function disableFormBrowserValidation(string $selector): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsineok
this is great! we will rake this into behat-steps library
AlexSkrypnyk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsineok
Great work! Please see my small comments.
tests/behat/features/contact.feature
Outdated
|
|
||
| @api @javascript | ||
| Scenario: Anonymous user can use the Contact link and Contact form. | ||
| Given I am on "homepage" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should start with a user type
Given I am an anonymous user
When I visit homepage <--- there is a step for a homepage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change this step to When I go to homepage.
When I visit homepage returned 404 response because the /homepage path doesn't exist on the site.
tests/behat/features/contact.feature
Outdated
| Scenario: Anonymous user can use the Contact link and Contact form. | ||
| Given I am on "homepage" | ||
| Then I should see the link Contact | ||
| Then I click the link with title Contact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use AND for the next steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes. I tried to use And, When, and Then to make scenarios sound like stories. As I understood, there is no technical difference between these steps.
Checklist before requesting a review
[#123] Verb in past tense.#123added to descriptionChangedsectionhttps://trello.com/c/yY7vUMax/177-website-add-behat-test-for-contact-form
./vendor/bin/behat -v --tags=contactChanged
Screenshots
Summary by CodeRabbit