-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
$I->seeElement required html tag? #5556
Comments
You could use seeInSource to match a bit of HTML. $I->seeInSource('<tr class="offset"'); |
So what are the exact requirements for |
Mentioning `<html>` tag requirement. See Codeception#5556 Question: Is `<html>` enough?
How does it fail? |
$I->sendAjaxPostRequest(...);
$I->seeElement(['css' => 'form']); fails with:
|
Just did some testing with
|
I looked into this, and I think that it is a bug that any assertion sees response of Ajax request. As far as I remember, the intention was that Ajax methods make requests that cause some side effects in backend, e.g. update database record, but the browser stays on the same page where it was before making Ajax request and the test can @DavertMik Can you confirm that? |
Originally, it was dealing with HTML responses because our site used to display popups via HTML. I may assume that nowadays underlying parser doesn't understand HTML without Anyway, there are less and less applications using Ajax approach, so I think this is minor issue. |
See Codeception/Codeception#5556 Second attempt after Codeception/Codeception#6004
I have AJAX endpoint that returns html markup of the items loaded on the page scroll. This isn't a jquery and isn't a full HTML document which I mean starts from HTML tag. My endpoint returns items that later will be included in the document like
$('#id').append(html);
I guess it's a common situation. But when I try to test this result for an element - it fails:
First line of AJAX response is
Looks like the seeElement function (and others) require the HTML document starting from HTML tag? Is there any possibility to test the response in my case?
The text was updated successfully, but these errors were encountered: