Home`
313 | * - ``
314 | *
315 | * For checking the raw source code, use `seeInSource()`.
316 | *
317 | * @param $text
318 | * @param null $selector
319 | * Conditional Assertion: Test won't be stopped on fail
320 | * @see \Codeception\Lib\InnerBrowser::dontSee()
321 | */
322 | public function cantSee($text, $selector = null) {
323 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
324 | }
325 | /**
326 | * [!] Method is generated. Documentation taken from corresponding module.
327 | *
328 | * Checks that the current page doesn't contain the text specified (case insensitive).
329 | * Give a locator as the second parameter to match a specific region.
330 | *
331 | * ```php
332 | * dontSee('Login'); // I can suppose user is already logged in
334 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
335 | * $I->dontSee('Sign Up','//body/h1'); // with XPath
336 | * ```
337 | *
338 | * Note that the search is done after stripping all HTML tags from the body,
339 | * so `$I->dontSee('strong')` will fail on strings like:
340 | *
341 | * - `
`
342 | * - ``
343 | *
344 | * But will ignore strings like:
345 | *
346 | * - `
Home`
348 | * - ``
349 | *
350 | * For checking the raw source code, use `seeInSource()`.
351 | *
352 | * @param $text
353 | * @param null $selector
354 | * @see \Codeception\Lib\InnerBrowser::dontSee()
355 | */
356 | public function dontSee($text, $selector = null) {
357 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args()));
358 | }
359 |
360 |
361 | /**
362 | * [!] Method is generated. Documentation taken from corresponding module.
363 | *
364 | * Checks that the current page contains the given string in its
365 | * raw source code.
366 | *
367 | * ``` php
368 | * seeInSource('
Green eggs & ham ');
370 | * ```
371 | *
372 | * @param $raw
373 | * Conditional Assertion: Test won't be stopped on fail
374 | * @see \Codeception\Lib\InnerBrowser::seeInSource()
375 | */
376 | public function canSeeInSource($raw) {
377 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args()));
378 | }
379 | /**
380 | * [!] Method is generated. Documentation taken from corresponding module.
381 | *
382 | * Checks that the current page contains the given string in its
383 | * raw source code.
384 | *
385 | * ``` php
386 | * seeInSource('
Green eggs & ham ');
388 | * ```
389 | *
390 | * @param $raw
391 | * @see \Codeception\Lib\InnerBrowser::seeInSource()
392 | */
393 | public function seeInSource($raw) {
394 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args()));
395 | }
396 |
397 |
398 | /**
399 | * [!] Method is generated. Documentation taken from corresponding module.
400 | *
401 | * Checks that the current page contains the given string in its
402 | * raw source code.
403 | *
404 | * ```php
405 | * dontSeeInSource('
Green eggs & ham ');
407 | * ```
408 | *
409 | * @param $raw
410 | * Conditional Assertion: Test won't be stopped on fail
411 | * @see \Codeception\Lib\InnerBrowser::dontSeeInSource()
412 | */
413 | public function cantSeeInSource($raw) {
414 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args()));
415 | }
416 | /**
417 | * [!] Method is generated. Documentation taken from corresponding module.
418 | *
419 | * Checks that the current page contains the given string in its
420 | * raw source code.
421 | *
422 | * ```php
423 | * dontSeeInSource('
Green eggs & ham ');
425 | * ```
426 | *
427 | * @param $raw
428 | * @see \Codeception\Lib\InnerBrowser::dontSeeInSource()
429 | */
430 | public function dontSeeInSource($raw) {
431 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInSource', func_get_args()));
432 | }
433 |
434 |
435 | /**
436 | * [!] Method is generated. Documentation taken from corresponding module.
437 | *
438 | * Checks that there's a link with the specified text.
439 | * Give a full URL as the second parameter to match links with that exact URL.
440 | *
441 | * ``` php
442 | * seeLink('Logout'); // matches
Logout
444 | * $I->seeLink('Logout','/logout'); // matches
Logout
445 | * ?>
446 | * ```
447 | *
448 | * @param $text
449 | * @param null $url
450 | * Conditional Assertion: Test won't be stopped on fail
451 | * @see \Codeception\Lib\InnerBrowser::seeLink()
452 | */
453 | public function canSeeLink($text, $url = null) {
454 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
455 | }
456 | /**
457 | * [!] Method is generated. Documentation taken from corresponding module.
458 | *
459 | * Checks that there's a link with the specified text.
460 | * Give a full URL as the second parameter to match links with that exact URL.
461 | *
462 | * ``` php
463 | * seeLink('Logout'); // matches
Logout
465 | * $I->seeLink('Logout','/logout'); // matches
Logout
466 | * ?>
467 | * ```
468 | *
469 | * @param $text
470 | * @param null $url
471 | * @see \Codeception\Lib\InnerBrowser::seeLink()
472 | */
473 | public function seeLink($text, $url = null) {
474 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
475 | }
476 |
477 |
478 | /**
479 | * [!] Method is generated. Documentation taken from corresponding module.
480 | *
481 | * Checks that the page doesn't contain a link with the given string.
482 | * If the second parameter is given, only links with a matching "href" attribute will be checked.
483 | *
484 | * ``` php
485 | * dontSeeLink('Logout'); // I suppose user is not logged in
487 | * $I->dontSeeLink('Checkout now', '/store/cart.php');
488 | * ?>
489 | * ```
490 | *
491 | * @param $text
492 | * @param null $url
493 | * Conditional Assertion: Test won't be stopped on fail
494 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink()
495 | */
496 | public function cantSeeLink($text, $url = null) {
497 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
498 | }
499 | /**
500 | * [!] Method is generated. Documentation taken from corresponding module.
501 | *
502 | * Checks that the page doesn't contain a link with the given string.
503 | * If the second parameter is given, only links with a matching "href" attribute will be checked.
504 | *
505 | * ``` php
506 | * dontSeeLink('Logout'); // I suppose user is not logged in
508 | * $I->dontSeeLink('Checkout now', '/store/cart.php');
509 | * ?>
510 | * ```
511 | *
512 | * @param $text
513 | * @param null $url
514 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink()
515 | */
516 | public function dontSeeLink($text, $url = null) {
517 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args()));
518 | }
519 |
520 |
521 | /**
522 | * [!] Method is generated. Documentation taken from corresponding module.
523 | *
524 | * Checks that current URI contains the given string.
525 | *
526 | * ``` php
527 | * seeInCurrentUrl('home');
530 | * // to match: /users/1
531 | * $I->seeInCurrentUrl('/users/');
532 | * ?>
533 | * ```
534 | *
535 | * @param $uri
536 | * Conditional Assertion: Test won't be stopped on fail
537 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
538 | */
539 | public function canSeeInCurrentUrl($uri) {
540 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
541 | }
542 | /**
543 | * [!] Method is generated. Documentation taken from corresponding module.
544 | *
545 | * Checks that current URI contains the given string.
546 | *
547 | * ``` php
548 | * seeInCurrentUrl('home');
551 | * // to match: /users/1
552 | * $I->seeInCurrentUrl('/users/');
553 | * ?>
554 | * ```
555 | *
556 | * @param $uri
557 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
558 | */
559 | public function seeInCurrentUrl($uri) {
560 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
561 | }
562 |
563 |
564 | /**
565 | * [!] Method is generated. Documentation taken from corresponding module.
566 | *
567 | * Checks that the current URI doesn't contain the given string.
568 | *
569 | * ``` php
570 | * dontSeeInCurrentUrl('/users/');
572 | * ?>
573 | * ```
574 | *
575 | * @param $uri
576 | * Conditional Assertion: Test won't be stopped on fail
577 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
578 | */
579 | public function cantSeeInCurrentUrl($uri) {
580 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
581 | }
582 | /**
583 | * [!] Method is generated. Documentation taken from corresponding module.
584 | *
585 | * Checks that the current URI doesn't contain the given string.
586 | *
587 | * ``` php
588 | * dontSeeInCurrentUrl('/users/');
590 | * ?>
591 | * ```
592 | *
593 | * @param $uri
594 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
595 | */
596 | public function dontSeeInCurrentUrl($uri) {
597 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args()));
598 | }
599 |
600 |
601 | /**
602 | * [!] Method is generated. Documentation taken from corresponding module.
603 | *
604 | * Checks that the current URL is equal to the given string.
605 | * Unlike `seeInCurrentUrl`, this only matches the full URL.
606 | *
607 | * ``` php
608 | * seeCurrentUrlEquals('/');
611 | * ?>
612 | * ```
613 | *
614 | * @param $uri
615 | * Conditional Assertion: Test won't be stopped on fail
616 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
617 | */
618 | public function canSeeCurrentUrlEquals($uri) {
619 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
620 | }
621 | /**
622 | * [!] Method is generated. Documentation taken from corresponding module.
623 | *
624 | * Checks that the current URL is equal to the given string.
625 | * Unlike `seeInCurrentUrl`, this only matches the full URL.
626 | *
627 | * ``` php
628 | * seeCurrentUrlEquals('/');
631 | * ?>
632 | * ```
633 | *
634 | * @param $uri
635 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
636 | */
637 | public function seeCurrentUrlEquals($uri) {
638 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
639 | }
640 |
641 |
642 | /**
643 | * [!] Method is generated. Documentation taken from corresponding module.
644 | *
645 | * Checks that the current URL doesn't equal the given string.
646 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
647 | *
648 | * ``` php
649 | * dontSeeCurrentUrlEquals('/');
652 | * ?>
653 | * ```
654 | *
655 | * @param $uri
656 | * Conditional Assertion: Test won't be stopped on fail
657 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
658 | */
659 | public function cantSeeCurrentUrlEquals($uri) {
660 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
661 | }
662 | /**
663 | * [!] Method is generated. Documentation taken from corresponding module.
664 | *
665 | * Checks that the current URL doesn't equal the given string.
666 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
667 | *
668 | * ``` php
669 | * dontSeeCurrentUrlEquals('/');
672 | * ?>
673 | * ```
674 | *
675 | * @param $uri
676 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
677 | */
678 | public function dontSeeCurrentUrlEquals($uri) {
679 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args()));
680 | }
681 |
682 |
683 | /**
684 | * [!] Method is generated. Documentation taken from corresponding module.
685 | *
686 | * Checks that the current URL matches the given regular expression.
687 | *
688 | * ``` php
689 | * seeCurrentUrlMatches('~$/users/(\d+)~');
692 | * ?>
693 | * ```
694 | *
695 | * @param $uri
696 | * Conditional Assertion: Test won't be stopped on fail
697 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
698 | */
699 | public function canSeeCurrentUrlMatches($uri) {
700 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
701 | }
702 | /**
703 | * [!] Method is generated. Documentation taken from corresponding module.
704 | *
705 | * Checks that the current URL matches the given regular expression.
706 | *
707 | * ``` php
708 | * seeCurrentUrlMatches('~$/users/(\d+)~');
711 | * ?>
712 | * ```
713 | *
714 | * @param $uri
715 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
716 | */
717 | public function seeCurrentUrlMatches($uri) {
718 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
719 | }
720 |
721 |
722 | /**
723 | * [!] Method is generated. Documentation taken from corresponding module.
724 | *
725 | * Checks that current url doesn't match the given regular expression.
726 | *
727 | * ``` php
728 | * dontSeeCurrentUrlMatches('~$/users/(\d+)~');
731 | * ?>
732 | * ```
733 | *
734 | * @param $uri
735 | * Conditional Assertion: Test won't be stopped on fail
736 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
737 | */
738 | public function cantSeeCurrentUrlMatches($uri) {
739 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
740 | }
741 | /**
742 | * [!] Method is generated. Documentation taken from corresponding module.
743 | *
744 | * Checks that current url doesn't match the given regular expression.
745 | *
746 | * ``` php
747 | * dontSeeCurrentUrlMatches('~$/users/(\d+)~');
750 | * ?>
751 | * ```
752 | *
753 | * @param $uri
754 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
755 | */
756 | public function dontSeeCurrentUrlMatches($uri) {
757 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args()));
758 | }
759 |
760 |
761 | /**
762 | * [!] Method is generated. Documentation taken from corresponding module.
763 | *
764 | * Executes the given regular expression against the current URI and returns the first match.
765 | * If no parameters are provided, the full URI is returned.
766 | *
767 | * ``` php
768 | * grabFromCurrentUrl('~$/user/(\d+)/~');
770 | * $uri = $I->grabFromCurrentUrl();
771 | * ?>
772 | * ```
773 | *
774 | * @param null $uri
775 | *
776 | * @return mixed
777 | * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
778 | */
779 | public function grabFromCurrentUrl($uri = null) {
780 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
781 | }
782 |
783 |
784 | /**
785 | * [!] Method is generated. Documentation taken from corresponding module.
786 | *
787 | * Checks that the specified checkbox is checked.
788 | *
789 | * ``` php
790 | * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
792 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
793 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
794 | * ?>
795 | * ```
796 | *
797 | * @param $checkbox
798 | * Conditional Assertion: Test won't be stopped on fail
799 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
800 | */
801 | public function canSeeCheckboxIsChecked($checkbox) {
802 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
803 | }
804 | /**
805 | * [!] Method is generated. Documentation taken from corresponding module.
806 | *
807 | * Checks that the specified checkbox is checked.
808 | *
809 | * ``` php
810 | * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
812 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
813 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
814 | * ?>
815 | * ```
816 | *
817 | * @param $checkbox
818 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
819 | */
820 | public function seeCheckboxIsChecked($checkbox) {
821 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
822 | }
823 |
824 |
825 | /**
826 | * [!] Method is generated. Documentation taken from corresponding module.
827 | *
828 | * Check that the specified checkbox is unchecked.
829 | *
830 | * ``` php
831 | * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
833 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
834 | * ?>
835 | * ```
836 | *
837 | * @param $checkbox
838 | * Conditional Assertion: Test won't be stopped on fail
839 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
840 | */
841 | public function cantSeeCheckboxIsChecked($checkbox) {
842 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
843 | }
844 | /**
845 | * [!] Method is generated. Documentation taken from corresponding module.
846 | *
847 | * Check that the specified checkbox is unchecked.
848 | *
849 | * ``` php
850 | * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
852 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
853 | * ?>
854 | * ```
855 | *
856 | * @param $checkbox
857 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
858 | */
859 | public function dontSeeCheckboxIsChecked($checkbox) {
860 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args()));
861 | }
862 |
863 |
864 | /**
865 | * [!] Method is generated. Documentation taken from corresponding module.
866 | *
867 | * Checks that the given input field or textarea contains the given value.
868 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
869 | *
870 | * ``` php
871 | * seeInField('Body','Type your comment here');
873 | * $I->seeInField('form textarea[name=body]','Type your comment here');
874 | * $I->seeInField('form input[type=hidden]','hidden_value');
875 | * $I->seeInField('#searchform input','Search');
876 | * $I->seeInField('//form/*[@name=search]','Search');
877 | * $I->seeInField(['name' => 'search'], 'Search');
878 | * ?>
879 | * ```
880 | *
881 | * @param $field
882 | * @param $value
883 | * Conditional Assertion: Test won't be stopped on fail
884 | * @see \Codeception\Lib\InnerBrowser::seeInField()
885 | */
886 | public function canSeeInField($field, $value) {
887 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
888 | }
889 | /**
890 | * [!] Method is generated. Documentation taken from corresponding module.
891 | *
892 | * Checks that the given input field or textarea contains the given value.
893 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
894 | *
895 | * ``` php
896 | * seeInField('Body','Type your comment here');
898 | * $I->seeInField('form textarea[name=body]','Type your comment here');
899 | * $I->seeInField('form input[type=hidden]','hidden_value');
900 | * $I->seeInField('#searchform input','Search');
901 | * $I->seeInField('//form/*[@name=search]','Search');
902 | * $I->seeInField(['name' => 'search'], 'Search');
903 | * ?>
904 | * ```
905 | *
906 | * @param $field
907 | * @param $value
908 | * @see \Codeception\Lib\InnerBrowser::seeInField()
909 | */
910 | public function seeInField($field, $value) {
911 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
912 | }
913 |
914 |
915 | /**
916 | * [!] Method is generated. Documentation taken from corresponding module.
917 | *
918 | * Checks that an input field or textarea doesn't contain the given value.
919 | * For fuzzy locators, the field is matched by label text, CSS and XPath.
920 | *
921 | * ``` php
922 | * dontSeeInField('Body','Type your comment here');
924 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
925 | * $I->dontSeeInField('form input[type=hidden]','hidden_value');
926 | * $I->dontSeeInField('#searchform input','Search');
927 | * $I->dontSeeInField('//form/*[@name=search]','Search');
928 | * $I->dontSeeInField(['name' => 'search'], 'Search');
929 | * ?>
930 | * ```
931 | *
932 | * @param $field
933 | * @param $value
934 | * Conditional Assertion: Test won't be stopped on fail
935 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField()
936 | */
937 | public function cantSeeInField($field, $value) {
938 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
939 | }
940 | /**
941 | * [!] Method is generated. Documentation taken from corresponding module.
942 | *
943 | * Checks that an input field or textarea doesn't contain the given value.
944 | * For fuzzy locators, the field is matched by label text, CSS and XPath.
945 | *
946 | * ``` php
947 | * dontSeeInField('Body','Type your comment here');
949 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
950 | * $I->dontSeeInField('form input[type=hidden]','hidden_value');
951 | * $I->dontSeeInField('#searchform input','Search');
952 | * $I->dontSeeInField('//form/*[@name=search]','Search');
953 | * $I->dontSeeInField(['name' => 'search'], 'Search');
954 | * ?>
955 | * ```
956 | *
957 | * @param $field
958 | * @param $value
959 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField()
960 | */
961 | public function dontSeeInField($field, $value) {
962 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args()));
963 | }
964 |
965 |
966 | /**
967 | * [!] Method is generated. Documentation taken from corresponding module.
968 | *
969 | * Checks if the array of form parameters (name => value) are set on the form matched with the
970 | * passed selector.
971 | *
972 | * ``` php
973 | * seeInFormFields('form[name=myform]', [
975 | * 'input1' => 'value',
976 | * 'input2' => 'other value',
977 | * ]);
978 | * ?>
979 | * ```
980 | *
981 | * For multi-select elements, or to check values of multiple elements with the same name, an
982 | * array may be passed:
983 | *
984 | * ``` php
985 | * seeInFormFields('.form-class', [
987 | * 'multiselect' => [
988 | * 'value1',
989 | * 'value2',
990 | * ],
991 | * 'checkbox[]' => [
992 | * 'a checked value',
993 | * 'another checked value',
994 | * ],
995 | * ]);
996 | * ?>
997 | * ```
998 | *
999 | * Additionally, checkbox values can be checked with a boolean.
1000 | *
1001 | * ``` php
1002 | * seeInFormFields('#form-id', [
1004 | * 'checkbox1' => true, // passes if checked
1005 | * 'checkbox2' => false, // passes if unchecked
1006 | * ]);
1007 | * ?>
1008 | * ```
1009 | *
1010 | * Pair this with submitForm for quick testing magic.
1011 | *
1012 | * ``` php
1013 | * 'value',
1016 | * 'field2' => 'another value',
1017 | * 'checkbox1' => true,
1018 | * // ...
1019 | * ];
1020 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
1021 | * // $I->amOnPage('/path/to/form-page') may be needed
1022 | * $I->seeInFormFields('//form[@id=my-form]', $form);
1023 | * ?>
1024 | * ```
1025 | *
1026 | * @param $formSelector
1027 | * @param $params
1028 | * Conditional Assertion: Test won't be stopped on fail
1029 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields()
1030 | */
1031 | public function canSeeInFormFields($formSelector, $params) {
1032 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args()));
1033 | }
1034 | /**
1035 | * [!] Method is generated. Documentation taken from corresponding module.
1036 | *
1037 | * Checks if the array of form parameters (name => value) are set on the form matched with the
1038 | * passed selector.
1039 | *
1040 | * ``` php
1041 | * seeInFormFields('form[name=myform]', [
1043 | * 'input1' => 'value',
1044 | * 'input2' => 'other value',
1045 | * ]);
1046 | * ?>
1047 | * ```
1048 | *
1049 | * For multi-select elements, or to check values of multiple elements with the same name, an
1050 | * array may be passed:
1051 | *
1052 | * ``` php
1053 | * seeInFormFields('.form-class', [
1055 | * 'multiselect' => [
1056 | * 'value1',
1057 | * 'value2',
1058 | * ],
1059 | * 'checkbox[]' => [
1060 | * 'a checked value',
1061 | * 'another checked value',
1062 | * ],
1063 | * ]);
1064 | * ?>
1065 | * ```
1066 | *
1067 | * Additionally, checkbox values can be checked with a boolean.
1068 | *
1069 | * ``` php
1070 | * seeInFormFields('#form-id', [
1072 | * 'checkbox1' => true, // passes if checked
1073 | * 'checkbox2' => false, // passes if unchecked
1074 | * ]);
1075 | * ?>
1076 | * ```
1077 | *
1078 | * Pair this with submitForm for quick testing magic.
1079 | *
1080 | * ``` php
1081 | * 'value',
1084 | * 'field2' => 'another value',
1085 | * 'checkbox1' => true,
1086 | * // ...
1087 | * ];
1088 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
1089 | * // $I->amOnPage('/path/to/form-page') may be needed
1090 | * $I->seeInFormFields('//form[@id=my-form]', $form);
1091 | * ?>
1092 | * ```
1093 | *
1094 | * @param $formSelector
1095 | * @param $params
1096 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields()
1097 | */
1098 | public function seeInFormFields($formSelector, $params) {
1099 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args()));
1100 | }
1101 |
1102 |
1103 | /**
1104 | * [!] Method is generated. Documentation taken from corresponding module.
1105 | *
1106 | * Checks if the array of form parameters (name => value) are not set on the form matched with
1107 | * the passed selector.
1108 | *
1109 | * ``` php
1110 | * dontSeeInFormFields('form[name=myform]', [
1112 | * 'input1' => 'non-existent value',
1113 | * 'input2' => 'other non-existent value',
1114 | * ]);
1115 | * ?>
1116 | * ```
1117 | *
1118 | * To check that an element hasn't been assigned any one of many values, an array can be passed
1119 | * as the value:
1120 | *
1121 | * ``` php
1122 | * dontSeeInFormFields('.form-class', [
1124 | * 'fieldName' => [
1125 | * 'This value shouldn\'t be set',
1126 | * 'And this value shouldn\'t be set',
1127 | * ],
1128 | * ]);
1129 | * ?>
1130 | * ```
1131 | *
1132 | * Additionally, checkbox values can be checked with a boolean.
1133 | *
1134 | * ``` php
1135 | * dontSeeInFormFields('#form-id', [
1137 | * 'checkbox1' => true, // fails if checked
1138 | * 'checkbox2' => false, // fails if unchecked
1139 | * ]);
1140 | * ?>
1141 | * ```
1142 | *
1143 | * @param $formSelector
1144 | * @param $params
1145 | * Conditional Assertion: Test won't be stopped on fail
1146 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
1147 | */
1148 | public function cantSeeInFormFields($formSelector, $params) {
1149 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args()));
1150 | }
1151 | /**
1152 | * [!] Method is generated. Documentation taken from corresponding module.
1153 | *
1154 | * Checks if the array of form parameters (name => value) are not set on the form matched with
1155 | * the passed selector.
1156 | *
1157 | * ``` php
1158 | * dontSeeInFormFields('form[name=myform]', [
1160 | * 'input1' => 'non-existent value',
1161 | * 'input2' => 'other non-existent value',
1162 | * ]);
1163 | * ?>
1164 | * ```
1165 | *
1166 | * To check that an element hasn't been assigned any one of many values, an array can be passed
1167 | * as the value:
1168 | *
1169 | * ``` php
1170 | * dontSeeInFormFields('.form-class', [
1172 | * 'fieldName' => [
1173 | * 'This value shouldn\'t be set',
1174 | * 'And this value shouldn\'t be set',
1175 | * ],
1176 | * ]);
1177 | * ?>
1178 | * ```
1179 | *
1180 | * Additionally, checkbox values can be checked with a boolean.
1181 | *
1182 | * ``` php
1183 | * dontSeeInFormFields('#form-id', [
1185 | * 'checkbox1' => true, // fails if checked
1186 | * 'checkbox2' => false, // fails if unchecked
1187 | * ]);
1188 | * ?>
1189 | * ```
1190 | *
1191 | * @param $formSelector
1192 | * @param $params
1193 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
1194 | */
1195 | public function dontSeeInFormFields($formSelector, $params) {
1196 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args()));
1197 | }
1198 |
1199 |
1200 | /**
1201 | * [!] Method is generated. Documentation taken from corresponding module.
1202 | *
1203 | * Submits the given form on the page, optionally with the given form
1204 | * values. Pass the form field's values as an array in the second
1205 | * parameter.
1206 | *
1207 | * Although this function can be used as a short-hand version of
1208 | * `fillField()`, `selectOption()`, `click()` etc. it has some important
1209 | * differences:
1210 | *
1211 | * * Only field *names* may be used, not CSS/XPath selectors nor field labels
1212 | * * If a field is sent to this function that does *not* exist on the page,
1213 | * it will silently be added to the HTTP request. This is helpful for testing
1214 | * some types of forms, but be aware that you will *not* get an exception
1215 | * like you would if you called `fillField()` or `selectOption()` with
1216 | * a missing field.
1217 | *
1218 | * Fields that are not provided will be filled by their values from the page,
1219 | * or from any previous calls to `fillField()`, `selectOption()` etc.
1220 | * You don't need to click the 'Submit' button afterwards.
1221 | * This command itself triggers the request to form's action.
1222 | *
1223 | * You can optionally specify which button's value to include
1224 | * in the request with the last parameter (as an alternative to
1225 | * explicitly setting its value in the second parameter), as
1226 | * button values are not otherwise included in the request.
1227 | *
1228 | * Examples:
1229 | *
1230 | * ``` php
1231 | * submitForm('#login', [
1233 | * 'login' => 'davert',
1234 | * 'password' => '123456'
1235 | * ]);
1236 | * // or
1237 | * $I->submitForm('#login', [
1238 | * 'login' => 'davert',
1239 | * 'password' => '123456'
1240 | * ], 'submitButtonName');
1241 | *
1242 | * ```
1243 | *
1244 | * For example, given this sample "Sign Up" form:
1245 | *
1246 | * ``` html
1247 | *
1261 | * ```
1262 | *
1263 | * You could write the following to submit it:
1264 | *
1265 | * ``` php
1266 | * submitForm(
1268 | * '#userForm',
1269 | * [
1270 | * 'user' => [
1271 | * 'login' => 'Davert',
1272 | * 'password' => '123456',
1273 | * 'agree' => true
1274 | * ]
1275 | * ],
1276 | * 'submitButton'
1277 | * );
1278 | * ```
1279 | * Note that "2" will be the submitted value for the "plan" field, as it is
1280 | * the selected option.
1281 | *
1282 | * You can also emulate a JavaScript submission by not specifying any
1283 | * buttons in the third parameter to submitForm.
1284 | *
1285 | * ```php
1286 | * submitForm(
1288 | * '#userForm',
1289 | * [
1290 | * 'user' => [
1291 | * 'login' => 'Davert',
1292 | * 'password' => '123456',
1293 | * 'agree' => true
1294 | * ]
1295 | * ]
1296 | * );
1297 | * ```
1298 | *
1299 | * This function works well when paired with `seeInFormFields()`
1300 | * for quickly testing CRUD interfaces and form validation logic.
1301 | *
1302 | * ``` php
1303 | * 'value',
1306 | * 'field2' => 'another value',
1307 | * 'checkbox1' => true,
1308 | * // ...
1309 | * ];
1310 | * $I->submitForm('#my-form', $form, 'submitButton');
1311 | * // $I->amOnPage('/path/to/form-page') may be needed
1312 | * $I->seeInFormFields('#my-form', $form);
1313 | * ```
1314 | *
1315 | * Parameter values can be set to arrays for multiple input fields
1316 | * of the same name, or multi-select combo boxes. For checkboxes,
1317 | * you can use either the string value or boolean `true`/`false` which will
1318 | * be replaced by the checkbox's value in the DOM.
1319 | *
1320 | * ``` php
1321 | * submitForm('#my-form', [
1323 | * 'field1' => 'value',
1324 | * 'checkbox' => [
1325 | * 'value of first checkbox',
1326 | * 'value of second checkbox',
1327 | * ],
1328 | * 'otherCheckboxes' => [
1329 | * true,
1330 | * false,
1331 | * false
1332 | * ],
1333 | * 'multiselect' => [
1334 | * 'first option value',
1335 | * 'second option value'
1336 | * ]
1337 | * ]);
1338 | * ```
1339 | *
1340 | * Mixing string and boolean values for a checkbox's value is not supported
1341 | * and may produce unexpected results.
1342 | *
1343 | * Field names ending in `[]` must be passed without the trailing square
1344 | * bracket characters, and must contain an array for its value. This allows
1345 | * submitting multiple values with the same name, consider:
1346 | *
1347 | * ```php
1348 | * submitForm('#my-form', [
1351 | * 'field[]' => 'value',
1352 | * 'field[]' => 'another value', // 'field[]' is already a defined key
1353 | * ]);
1354 | * ```
1355 | *
1356 | * The solution is to pass an array value:
1357 | *
1358 | * ```php
1359 | * submitForm('#my-form', [
1362 | * 'field' => [
1363 | * 'value',
1364 | * 'another value',
1365 | * ]
1366 | * ]);
1367 | * ```
1368 | *
1369 | * @param $selector
1370 | * @param $params
1371 | * @param $button
1372 | * @see \Codeception\Lib\InnerBrowser::submitForm()
1373 | */
1374 | public function submitForm($selector, $params, $button = null) {
1375 | return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
1376 | }
1377 |
1378 |
1379 | /**
1380 | * [!] Method is generated. Documentation taken from corresponding module.
1381 | *
1382 | * Fills a text field or textarea with the given string.
1383 | *
1384 | * ``` php
1385 | * fillField("//input[@type='text']", "Hello World!");
1387 | * $I->fillField(['name' => 'email'], 'jon@mail.com');
1388 | * ?>
1389 | * ```
1390 | *
1391 | * @param $field
1392 | * @param $value
1393 | * @see \Codeception\Lib\InnerBrowser::fillField()
1394 | */
1395 | public function fillField($field, $value) {
1396 | return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args()));
1397 | }
1398 |
1399 |
1400 | /**
1401 | * [!] Method is generated. Documentation taken from corresponding module.
1402 | *
1403 | * Selects an option in a select tag or in radio button group.
1404 | *
1405 | * ``` php
1406 | * selectOption('form select[name=account]', 'Premium');
1408 | * $I->selectOption('form input[name=payment]', 'Monthly');
1409 | * $I->selectOption('//form/select[@name=account]', 'Monthly');
1410 | * ?>
1411 | * ```
1412 | *
1413 | * Provide an array for the second argument to select multiple options:
1414 | *
1415 | * ``` php
1416 | * selectOption('Which OS do you use?', array('Windows','Linux'));
1418 | * ?>
1419 | * ```
1420 | *
1421 | * @param $select
1422 | * @param $option
1423 | * @see \Codeception\Lib\InnerBrowser::selectOption()
1424 | */
1425 | public function selectOption($select, $option) {
1426 | return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args()));
1427 | }
1428 |
1429 |
1430 | /**
1431 | * [!] Method is generated. Documentation taken from corresponding module.
1432 | *
1433 | * Ticks a checkbox. For radio buttons, use the `selectOption` method instead.
1434 | *
1435 | * ``` php
1436 | * checkOption('#agree');
1438 | * ?>
1439 | * ```
1440 | *
1441 | * @param $option
1442 | * @see \Codeception\Lib\InnerBrowser::checkOption()
1443 | */
1444 | public function checkOption($option) {
1445 | return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args()));
1446 | }
1447 |
1448 |
1449 | /**
1450 | * [!] Method is generated. Documentation taken from corresponding module.
1451 | *
1452 | * Unticks a checkbox.
1453 | *
1454 | * ``` php
1455 | * uncheckOption('#notify');
1457 | * ?>
1458 | * ```
1459 | *
1460 | * @param $option
1461 | * @see \Codeception\Lib\InnerBrowser::uncheckOption()
1462 | */
1463 | public function uncheckOption($option) {
1464 | return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
1465 | }
1466 |
1467 |
1468 | /**
1469 | * [!] Method is generated. Documentation taken from corresponding module.
1470 | *
1471 | * Attaches a file relative to the Codeception data directory to the given file upload field.
1472 | *
1473 | * ``` php
1474 | * attachFile('input[@type="file"]', 'prices.xls');
1477 | * ?>
1478 | * ```
1479 | *
1480 | * @param $field
1481 | * @param $filename
1482 | * @see \Codeception\Lib\InnerBrowser::attachFile()
1483 | */
1484 | public function attachFile($field, $filename) {
1485 | return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args()));
1486 | }
1487 |
1488 |
1489 | /**
1490 | * [!] Method is generated. Documentation taken from corresponding module.
1491 | *
1492 | * If your page triggers an ajax request, you can perform it manually.
1493 | * This action sends a GET ajax request with specified params.
1494 | *
1495 | * See ->sendAjaxPostRequest for examples.
1496 | *
1497 | * @param $uri
1498 | * @param $params
1499 | * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
1500 | */
1501 | public function sendAjaxGetRequest($uri, $params = null) {
1502 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args()));
1503 | }
1504 |
1505 |
1506 | /**
1507 | * [!] Method is generated. Documentation taken from corresponding module.
1508 | *
1509 | * If your page triggers an ajax request, you can perform it manually.
1510 | * This action sends a POST ajax request with specified params.
1511 | * Additional params can be passed as array.
1512 | *
1513 | * Example:
1514 | *
1515 | * Imagine that by clicking checkbox you trigger ajax request which updates user settings.
1516 | * We emulate that click by running this ajax request manually.
1517 | *
1518 | * ``` php
1519 | * sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST
1521 | * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET
1522 | *
1523 | * ```
1524 | *
1525 | * @param $uri
1526 | * @param $params
1527 | * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
1528 | */
1529 | public function sendAjaxPostRequest($uri, $params = null) {
1530 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args()));
1531 | }
1532 |
1533 |
1534 | /**
1535 | * [!] Method is generated. Documentation taken from corresponding module.
1536 | *
1537 | * If your page triggers an ajax request, you can perform it manually.
1538 | * This action sends an ajax request with specified method and params.
1539 | *
1540 | * Example:
1541 | *
1542 | * You need to perform an ajax request specifying the HTTP method.
1543 | *
1544 | * ``` php
1545 | * sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title'));
1547 | *
1548 | * ```
1549 | *
1550 | * @param $method
1551 | * @param $uri
1552 | * @param $params
1553 | * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest()
1554 | */
1555 | public function sendAjaxRequest($method, $uri, $params = null) {
1556 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args()));
1557 | }
1558 |
1559 |
1560 | /**
1561 | * [!] Method is generated. Documentation taken from corresponding module.
1562 | *
1563 | * Finds and returns the text contents of the given element.
1564 | * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression.
1565 | *
1566 | * ``` php
1567 | * grabTextFrom('h1');
1569 | * $heading = $I->grabTextFrom('descendant-or-self::h1');
1570 | * $value = $I->grabTextFrom('~
1572 | * ```
1573 | *
1574 | * @param $cssOrXPathOrRegex
1575 | *
1576 | * @return mixed
1577 | * @see \Codeception\Lib\InnerBrowser::grabTextFrom()
1578 | */
1579 | public function grabTextFrom($cssOrXPathOrRegex) {
1580 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
1581 | }
1582 |
1583 |
1584 | /**
1585 | * [!] Method is generated. Documentation taken from corresponding module.
1586 | *
1587 | * Grabs the value of the given attribute value from the given element.
1588 | * Fails if element is not found.
1589 | *
1590 | * ``` php
1591 | * grabAttributeFrom('#tooltip', 'title');
1593 | * ?>
1594 | * ```
1595 | *
1596 | *
1597 | * @param $cssOrXpath
1598 | * @param $attribute
1599 | *
1600 | * @return mixed
1601 | * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom()
1602 | */
1603 | public function grabAttributeFrom($cssOrXpath, $attribute) {
1604 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args()));
1605 | }
1606 |
1607 |
1608 | /**
1609 | * [!] Method is generated. Documentation taken from corresponding module.
1610 | *
1611 | * Grabs either the text content, or attribute values, of nodes
1612 | * matched by $cssOrXpath and returns them as an array.
1613 | *
1614 | * ```html
1615 | *
First
1616 | *
Second
1617 | *
Third
1618 | * ```
1619 | *
1620 | * ```php
1621 | * grabMultiple('a');
1624 | *
1625 | * // would return ['#first', '#second', '#third']
1626 | * $aLinks = $I->grabMultiple('a', 'href');
1627 | * ?>
1628 | * ```
1629 | *
1630 | * @param $cssOrXpath
1631 | * @param $attribute
1632 | * @return string[]
1633 | * @see \Codeception\Lib\InnerBrowser::grabMultiple()
1634 | */
1635 | public function grabMultiple($cssOrXpath, $attribute = null) {
1636 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args()));
1637 | }
1638 |
1639 |
1640 | /**
1641 | * [!] Method is generated. Documentation taken from corresponding module.
1642 | *
1643 | * @param $field
1644 | *
1645 | * @return array|mixed|null|string
1646 | * @see \Codeception\Lib\InnerBrowser::grabValueFrom()
1647 | */
1648 | public function grabValueFrom($field) {
1649 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
1650 | }
1651 |
1652 |
1653 | /**
1654 | * [!] Method is generated. Documentation taken from corresponding module.
1655 | *
1656 | * Sets a cookie with the given name and value.
1657 | * You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument.
1658 | *
1659 | * ``` php
1660 | * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3');
1662 | * ?>
1663 | * ```
1664 | *
1665 | * @param $name
1666 | * @param $val
1667 | * @param array $params
1668 | *
1669 | * @return mixed
1670 | * @see \Codeception\Lib\InnerBrowser::setCookie()
1671 | */
1672 | public function setCookie($name, $val, $params = null) {
1673 | return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
1674 | }
1675 |
1676 |
1677 | /**
1678 | * [!] Method is generated. Documentation taken from corresponding module.
1679 | *
1680 | * Grabs a cookie value.
1681 | * You can set additional cookie params like `domain`, `path` in array passed as last argument.
1682 | *
1683 | * @param $cookie
1684 | *
1685 | * @param array $params
1686 | * @return mixed
1687 | * @see \Codeception\Lib\InnerBrowser::grabCookie()
1688 | */
1689 | public function grabCookie($cookie, $params = null) {
1690 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
1691 | }
1692 |
1693 |
1694 | /**
1695 | * [!] Method is generated. Documentation taken from corresponding module.
1696 | *
1697 | * Checks that a cookie with the given name is set.
1698 | * You can set additional cookie params like `domain`, `path` as array passed in last argument.
1699 | *
1700 | * ``` php
1701 | * seeCookie('PHPSESSID');
1703 | * ?>
1704 | * ```
1705 | *
1706 | * @param $cookie
1707 | * @param array $params
1708 | * @return mixed
1709 | * Conditional Assertion: Test won't be stopped on fail
1710 | * @see \Codeception\Lib\InnerBrowser::seeCookie()
1711 | */
1712 | public function canSeeCookie($cookie, $params = null) {
1713 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
1714 | }
1715 | /**
1716 | * [!] Method is generated. Documentation taken from corresponding module.
1717 | *
1718 | * Checks that a cookie with the given name is set.
1719 | * You can set additional cookie params like `domain`, `path` as array passed in last argument.
1720 | *
1721 | * ``` php
1722 | * seeCookie('PHPSESSID');
1724 | * ?>
1725 | * ```
1726 | *
1727 | * @param $cookie
1728 | * @param array $params
1729 | * @return mixed
1730 | * @see \Codeception\Lib\InnerBrowser::seeCookie()
1731 | */
1732 | public function seeCookie($cookie, $params = null) {
1733 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
1734 | }
1735 |
1736 |
1737 | /**
1738 | * [!] Method is generated. Documentation taken from corresponding module.
1739 | *
1740 | * Checks that there isn't a cookie with the given name.
1741 | * You can set additional cookie params like `domain`, `path` as array passed in last argument.
1742 | *
1743 | * @param $cookie
1744 | *
1745 | * @param array $params
1746 | * @return mixed
1747 | * Conditional Assertion: Test won't be stopped on fail
1748 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
1749 | */
1750 | public function cantSeeCookie($cookie, $params = null) {
1751 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
1752 | }
1753 | /**
1754 | * [!] Method is generated. Documentation taken from corresponding module.
1755 | *
1756 | * Checks that there isn't a cookie with the given name.
1757 | * You can set additional cookie params like `domain`, `path` as array passed in last argument.
1758 | *
1759 | * @param $cookie
1760 | *
1761 | * @param array $params
1762 | * @return mixed
1763 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
1764 | */
1765 | public function dontSeeCookie($cookie, $params = null) {
1766 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args()));
1767 | }
1768 |
1769 |
1770 | /**
1771 | * [!] Method is generated. Documentation taken from corresponding module.
1772 | *
1773 | * Unsets cookie with the given name.
1774 | * You can set additional cookie params like `domain`, `path` in array passed as last argument.
1775 | *
1776 | * @param $cookie
1777 | *
1778 | * @param array $params
1779 | * @return mixed
1780 | * @see \Codeception\Lib\InnerBrowser::resetCookie()
1781 | */
1782 | public function resetCookie($name, $params = null) {
1783 | return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
1784 | }
1785 |
1786 |
1787 | /**
1788 | * [!] Method is generated. Documentation taken from corresponding module.
1789 | *
1790 | * Checks that the given element exists on the page and is visible.
1791 | * You can also specify expected attributes of this element.
1792 | *
1793 | * ``` php
1794 | * seeElement('.error');
1796 | * $I->seeElement('//form/input[1]');
1797 | * $I->seeElement('input', ['name' => 'login']);
1798 | * $I->seeElement('input', ['value' => '123456']);
1799 | *
1800 | * // strict locator in first arg, attributes in second
1801 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
1802 | * ?>
1803 | * ```
1804 | *
1805 | * @param $selector
1806 | * @param array $attributes
1807 | * @return
1808 | * Conditional Assertion: Test won't be stopped on fail
1809 | * @see \Codeception\Lib\InnerBrowser::seeElement()
1810 | */
1811 | public function canSeeElement($selector, $attributes = null) {
1812 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
1813 | }
1814 | /**
1815 | * [!] Method is generated. Documentation taken from corresponding module.
1816 | *
1817 | * Checks that the given element exists on the page and is visible.
1818 | * You can also specify expected attributes of this element.
1819 | *
1820 | * ``` php
1821 | * seeElement('.error');
1823 | * $I->seeElement('//form/input[1]');
1824 | * $I->seeElement('input', ['name' => 'login']);
1825 | * $I->seeElement('input', ['value' => '123456']);
1826 | *
1827 | * // strict locator in first arg, attributes in second
1828 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
1829 | * ?>
1830 | * ```
1831 | *
1832 | * @param $selector
1833 | * @param array $attributes
1834 | * @return
1835 | * @see \Codeception\Lib\InnerBrowser::seeElement()
1836 | */
1837 | public function seeElement($selector, $attributes = null) {
1838 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
1839 | }
1840 |
1841 |
1842 | /**
1843 | * [!] Method is generated. Documentation taken from corresponding module.
1844 | *
1845 | * Checks that the given element is invisible or not present on the page.
1846 | * You can also specify expected attributes of this element.
1847 | *
1848 | * ``` php
1849 | * dontSeeElement('.error');
1851 | * $I->dontSeeElement('//form/input[1]');
1852 | * $I->dontSeeElement('input', ['name' => 'login']);
1853 | * $I->dontSeeElement('input', ['value' => '123456']);
1854 | * ?>
1855 | * ```
1856 | *
1857 | * @param $selector
1858 | * @param array $attributes
1859 | * Conditional Assertion: Test won't be stopped on fail
1860 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement()
1861 | */
1862 | public function cantSeeElement($selector, $attributes = null) {
1863 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
1864 | }
1865 | /**
1866 | * [!] Method is generated. Documentation taken from corresponding module.
1867 | *
1868 | * Checks that the given element is invisible or not present on the page.
1869 | * You can also specify expected attributes of this element.
1870 | *
1871 | * ``` php
1872 | * dontSeeElement('.error');
1874 | * $I->dontSeeElement('//form/input[1]');
1875 | * $I->dontSeeElement('input', ['name' => 'login']);
1876 | * $I->dontSeeElement('input', ['value' => '123456']);
1877 | * ?>
1878 | * ```
1879 | *
1880 | * @param $selector
1881 | * @param array $attributes
1882 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement()
1883 | */
1884 | public function dontSeeElement($selector, $attributes = null) {
1885 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
1886 | }
1887 |
1888 |
1889 | /**
1890 | * [!] Method is generated. Documentation taken from corresponding module.
1891 | *
1892 | * Checks that there are a certain number of elements matched by the given locator on the page.
1893 | *
1894 | * ``` php
1895 | * seeNumberOfElements('tr', 10);
1897 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
1898 | * ?>
1899 | * ```
1900 | * @param $selector
1901 | * @param mixed $expected :
1902 | * - string: strict number
1903 | * - array: range of numbers [0,10]
1904 | * Conditional Assertion: Test won't be stopped on fail
1905 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
1906 | */
1907 | public function canSeeNumberOfElements($selector, $expected) {
1908 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args()));
1909 | }
1910 | /**
1911 | * [!] Method is generated. Documentation taken from corresponding module.
1912 | *
1913 | * Checks that there are a certain number of elements matched by the given locator on the page.
1914 | *
1915 | * ``` php
1916 | * seeNumberOfElements('tr', 10);
1918 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
1919 | * ?>
1920 | * ```
1921 | * @param $selector
1922 | * @param mixed $expected :
1923 | * - string: strict number
1924 | * - array: range of numbers [0,10]
1925 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
1926 | */
1927 | public function seeNumberOfElements($selector, $expected) {
1928 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args()));
1929 | }
1930 |
1931 |
1932 | /**
1933 | * [!] Method is generated. Documentation taken from corresponding module.
1934 | *
1935 | * Checks that the given option is selected.
1936 | *
1937 | * ``` php
1938 | * seeOptionIsSelected('#form input[name=payment]', 'Visa');
1940 | * ?>
1941 | * ```
1942 | *
1943 | * @param $selector
1944 | * @param $optionText
1945 | *
1946 | * @return mixed
1947 | * Conditional Assertion: Test won't be stopped on fail
1948 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
1949 | */
1950 | public function canSeeOptionIsSelected($selector, $optionText) {
1951 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
1952 | }
1953 | /**
1954 | * [!] Method is generated. Documentation taken from corresponding module.
1955 | *
1956 | * Checks that the given option is selected.
1957 | *
1958 | * ``` php
1959 | * seeOptionIsSelected('#form input[name=payment]', 'Visa');
1961 | * ?>
1962 | * ```
1963 | *
1964 | * @param $selector
1965 | * @param $optionText
1966 | *
1967 | * @return mixed
1968 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
1969 | */
1970 | public function seeOptionIsSelected($selector, $optionText) {
1971 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
1972 | }
1973 |
1974 |
1975 | /**
1976 | * [!] Method is generated. Documentation taken from corresponding module.
1977 | *
1978 | * Checks that the given option is not selected.
1979 | *
1980 | * ``` php
1981 | * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
1983 | * ?>
1984 | * ```
1985 | *
1986 | * @param $selector
1987 | * @param $optionText
1988 | *
1989 | * @return mixed
1990 | * Conditional Assertion: Test won't be stopped on fail
1991 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
1992 | */
1993 | public function cantSeeOptionIsSelected($selector, $optionText) {
1994 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
1995 | }
1996 | /**
1997 | * [!] Method is generated. Documentation taken from corresponding module.
1998 | *
1999 | * Checks that the given option is not selected.
2000 | *
2001 | * ``` php
2002 | * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
2004 | * ?>
2005 | * ```
2006 | *
2007 | * @param $selector
2008 | * @param $optionText
2009 | *
2010 | * @return mixed
2011 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
2012 | */
2013 | public function dontSeeOptionIsSelected($selector, $optionText) {
2014 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
2015 | }
2016 |
2017 |
2018 | /**
2019 | * [!] Method is generated. Documentation taken from corresponding module.
2020 | *
2021 | * Asserts that current page has 404 response status code.
2022 | * Conditional Assertion: Test won't be stopped on fail
2023 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound()
2024 | */
2025 | public function canSeePageNotFound() {
2026 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args()));
2027 | }
2028 | /**
2029 | * [!] Method is generated. Documentation taken from corresponding module.
2030 | *
2031 | * Asserts that current page has 404 response status code.
2032 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound()
2033 | */
2034 | public function seePageNotFound() {
2035 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args()));
2036 | }
2037 |
2038 |
2039 | /**
2040 | * [!] Method is generated. Documentation taken from corresponding module.
2041 | *
2042 | * Checks that response code is equal to value provided.
2043 | *
2044 | * @param $code
2045 | *
2046 | * @return mixed
2047 | * Conditional Assertion: Test won't be stopped on fail
2048 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
2049 | */
2050 | public function canSeeResponseCodeIs($code) {
2051 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args()));
2052 | }
2053 | /**
2054 | * [!] Method is generated. Documentation taken from corresponding module.
2055 | *
2056 | * Checks that response code is equal to value provided.
2057 | *
2058 | * @param $code
2059 | *
2060 | * @return mixed
2061 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
2062 | */
2063 | public function seeResponseCodeIs($code) {
2064 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args()));
2065 | }
2066 |
2067 |
2068 | /**
2069 | * [!] Method is generated. Documentation taken from corresponding module.
2070 | *
2071 | * Checks that the page title contains the given string.
2072 | *
2073 | * ``` php
2074 | * seeInTitle('Blog - Post #1');
2076 | * ?>
2077 | * ```
2078 | *
2079 | * @param $title
2080 | *
2081 | * @return mixed
2082 | * Conditional Assertion: Test won't be stopped on fail
2083 | * @see \Codeception\Lib\InnerBrowser::seeInTitle()
2084 | */
2085 | public function canSeeInTitle($title) {
2086 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
2087 | }
2088 | /**
2089 | * [!] Method is generated. Documentation taken from corresponding module.
2090 | *
2091 | * Checks that the page title contains the given string.
2092 | *
2093 | * ``` php
2094 | * seeInTitle('Blog - Post #1');
2096 | * ?>
2097 | * ```
2098 | *
2099 | * @param $title
2100 | *
2101 | * @return mixed
2102 | * @see \Codeception\Lib\InnerBrowser::seeInTitle()
2103 | */
2104 | public function seeInTitle($title) {
2105 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
2106 | }
2107 |
2108 |
2109 | /**
2110 | * [!] Method is generated. Documentation taken from corresponding module.
2111 | *
2112 | * Checks that the page title does not contain the given string.
2113 | *
2114 | * @param $title
2115 | *
2116 | * @return mixed
2117 | * Conditional Assertion: Test won't be stopped on fail
2118 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
2119 | */
2120 | public function cantSeeInTitle($title) {
2121 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
2122 | }
2123 | /**
2124 | * [!] Method is generated. Documentation taken from corresponding module.
2125 | *
2126 | * Checks that the page title does not contain the given string.
2127 | *
2128 | * @param $title
2129 | *
2130 | * @return mixed
2131 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
2132 | */
2133 | public function dontSeeInTitle($title) {
2134 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
2135 | }
2136 |
2137 |
2138 | /**
2139 | * [!] Method is generated. Documentation taken from corresponding module.
2140 | *
2141 | * Switch to iframe or frame on the page.
2142 | *
2143 | * Example:
2144 | * ``` html
2145 | *