Version Description
(May 22, 2020) = * Bug: Removed static data from about us page. * Bug: Fixed progress bar JS error and its calculation issues. * Bug: Fixed issue with spaces before tables in questions. * Bug: Fixed scroll to top issue for pagination. * Bug: Fixed incorrect calculation with %AMOUNT_CORRECT% and %POINT_SCORE% variables. * Bug: Removed unnecessary query repetitions. * Enhancement: Added filter to add additional data to email content. * Enhancement: Trim white space at the end of text answers. * Enhancement: Created new function to check whether plugin is activated or not (https://wordpress.org/support/topic/error-on-submitting-quiz/#post-12821263) * Enhancement: Added progress bar support for options tab pagination. * Enhancement: Added new variable %QUESTION_ANSWER_X% to show specific questions answer.
Release Info
Developer | expresstech |
Plugin | Quiz And Survey Master (Formerly Quiz Master Next) |
Version | 6.4.11 |
Comparing to | |
See all releases |
Code changes from version 6.4.10 to 6.4.11
- codeception.dist.yml +21 -0
- composer.json +8 -0
- css/common.css +14 -0
- css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- css/qsm-admin.css +1 -1
- js/qsm-admin-question.js +1 -1
- js/qsm-quiz.js +124 -19
- mlw_quizmaster2.php +3 -3
- php/admin/about-page.php +4 -29
- php/admin/functions.php +13 -11
- php/admin/options-page-email-tab.php +3 -0
- php/admin/options-page-results-page-tab.php +3 -0
- php/classes/class-qmn-quiz-manager.php +41 -6
- php/classes/class-qsm-questions.php +1 -1
- php/question-types.php +1 -1
- php/shortcodes.php +0 -23
- php/template-variables.php +56 -0
- readme.txt +20 -7
- templates/qmn_amethyst.css +1 -1
- templates/qmn_base.css +1 -1
- templates/qmn_emerald.css +1 -1
- templates/qmn_gray.css +1 -1
- templates/qmn_primary.css +1 -1
- templates/qmn_turquoise.css +1 -1
- tests/_support/AcceptanceTester.php +26 -0
- tests/_support/FunctionalTester.php +26 -0
- tests/_support/Helper/Acceptance.php +10 -0
- tests/_support/Helper/Functional.php +10 -0
- tests/_support/Helper/Unit.php +10 -0
- tests/_support/Helper/Wpunit.php +10 -0
- tests/_support/UnitTester.php +26 -0
- tests/_support/WpunitTester.php +26 -0
- tests/_support/_generated/AcceptanceTesterActions.php +3702 -0
- tests/_support/_generated/FunctionalTesterActions.php +963 -0
- tests/_support/_generated/UnitTesterActions.php +963 -0
- tests/_support/_generated/WpunitTesterActions.php +16 -0
- tests/acceptance.suite.yml +64 -0
- tests/acceptance/InstallPluginCest.php +125 -0
- tests/functional.suite.yml +40 -0
- tests/unit.suite.yml +10 -0
- tests/wpunit.suite.yml +22 -0
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
paths:
|
2 |
+
tests: tests
|
3 |
+
output: tests/_output
|
4 |
+
data: tests/_data
|
5 |
+
support: tests/_support
|
6 |
+
envs: tests/_envs
|
7 |
+
actor_suffix: Tester
|
8 |
+
extensions:
|
9 |
+
enabled:
|
10 |
+
- Codeception\Extension\RunFailed
|
11 |
+
commands:
|
12 |
+
- Codeception\Command\GenerateWPUnit
|
13 |
+
- Codeception\Command\GenerateWPRestApi
|
14 |
+
- Codeception\Command\GenerateWPRestController
|
15 |
+
- Codeception\Command\GenerateWPRestPostTypeController
|
16 |
+
- Codeception\Command\GenerateWPAjax
|
17 |
+
- Codeception\Command\GenerateWPCanonical
|
18 |
+
- Codeception\Command\GenerateWPXMLRPC
|
19 |
+
|
20 |
+
params:
|
21 |
+
- .env.testing
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"require-dev": {
|
3 |
+
"lucatume/wp-browser": "^2.5",
|
4 |
+
"codeception/module-asserts": "^1.2",
|
5 |
+
"codeception/module-webdriver": "^1.0",
|
6 |
+
"fzaninotto/faker": "^1.9"
|
7 |
+
}
|
8 |
+
}
|
@@ -117,6 +117,20 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
|
|
117 |
.qsm-quiz-container .qsm-contact-type-checkbox input{
|
118 |
display: inline-block;
|
119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
@media screen and (max-width: 767px){
|
121 |
.question-type-polar-s .left-polar-title,
|
122 |
.question-type-polar-s .slider-main-wrapper,
|
117 |
.qsm-quiz-container .qsm-contact-type-checkbox input{
|
118 |
display: inline-block;
|
119 |
}
|
120 |
+
.quiz_section iframe{
|
121 |
+
width: 100% !important;
|
122 |
+
min-height: 315px !important;
|
123 |
+
}
|
124 |
+
.qsm-progress-bar .progressbar-text{
|
125 |
+
position: absolute;
|
126 |
+
padding: 0px;
|
127 |
+
margin: 0px;
|
128 |
+
top: 10px !important;
|
129 |
+
right: 10px;
|
130 |
+
font-size: 13px;
|
131 |
+
font-weight: bold;
|
132 |
+
color: rgb(52, 152, 219);
|
133 |
+
}
|
134 |
@media screen and (max-width: 767px){
|
135 |
.question-type-polar-s .left-polar-title,
|
136 |
.question-type-polar-s .slider-main-wrapper,
|
Binary file
|
@@ -599,7 +599,7 @@ body .qsm-popup__btn-primary {
|
|
599 |
}
|
600 |
|
601 |
.qsm-popup-slide.is-open {
|
602 |
-
display: block;
|
603 |
}
|
604 |
|
605 |
.qsm-popup-slide[aria-hidden="false"] .qsm-popup__overlay {
|
599 |
}
|
600 |
|
601 |
.qsm-popup-slide.is-open {
|
602 |
+
display: block !important;
|
603 |
}
|
604 |
|
605 |
.qsm-popup-slide[aria-hidden="false"] .qsm-popup__overlay {
|
@@ -313,7 +313,7 @@ var import_button;
|
|
313 |
var ta_id = $answer.find('textarea').attr('id')
|
314 |
answer = wp.editor.getContent( ta_id );
|
315 |
}else{
|
316 |
-
answer = $answer.find( '.answer-text' ).val();
|
317 |
}
|
318 |
|
319 |
var points = $answer.find( '.answer-points' ).val();
|
313 |
var ta_id = $answer.find('textarea').attr('id')
|
314 |
answer = wp.editor.getContent( ta_id );
|
315 |
}else{
|
316 |
+
answer = $answer.find( '.answer-text' ).val().trim();
|
317 |
}
|
318 |
|
319 |
var points = $answer.find( '.answer-points' ).val();
|
@@ -266,8 +266,8 @@ var QSM;
|
|
266 |
$quizForm.find( '.qsm-pagination' ).append( '<input type="hidden" value="0" name="current_page" class="current_page_hidden" />');
|
267 |
}
|
268 |
if ( '1' == qmn_quiz_data[ quizID ].progress_bar ) {
|
269 |
-
|
270 |
-
qmn_quiz_data[ quizID ].bar = new ProgressBar.Line('#qsm-progress-bar', {
|
271 |
strokeWidth: 2,
|
272 |
easing: 'easeInOut',
|
273 |
duration: 1400,
|
@@ -292,7 +292,7 @@ var QSM;
|
|
292 |
from: {color: '#3498db'},
|
293 |
to: {color: '#ED6A5A'},
|
294 |
step: function(state, bar) {
|
295 |
-
|
296 |
}
|
297 |
});
|
298 |
}
|
@@ -300,10 +300,14 @@ var QSM;
|
|
300 |
$quizForm.find( '.qsm-pagination .qsm-next' ).on( 'click', function( event ) {
|
301 |
event.preventDefault();
|
302 |
QSM.nextPage( quizID );
|
|
|
|
|
303 |
});
|
304 |
$quizForm.find( '.qsm-pagination .qsm-previous' ).on( 'click', function( event ) {
|
305 |
event.preventDefault();
|
306 |
QSM.prevPage( quizID );
|
|
|
|
|
307 |
});
|
308 |
}
|
309 |
},
|
@@ -330,7 +334,32 @@ var QSM;
|
|
330 |
$quizForm.find( '.qsm-previous' ).show();
|
331 |
}
|
332 |
if ( '1' == qmn_quiz_data[ quizID ].progress_bar ) {
|
333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
}
|
335 |
QSM.savePage( quizID, pageNumber );
|
336 |
},
|
@@ -712,13 +741,17 @@ function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
|
|
712 |
var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
|
713 |
var total_page_number = Math.ceil(total_questions / pagination);
|
714 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
|
715 |
-
if(page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
|
716 |
-
|
717 |
-
|
|
|
|
|
|
|
|
|
718 |
}else{
|
719 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
720 |
}
|
721 |
-
|
722 |
}
|
723 |
|
724 |
function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
|
@@ -768,18 +801,58 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
|
|
768 |
qsmScrollTo( $container );
|
769 |
}
|
770 |
var hiddem_page_number = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val();
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
if(hiddem_page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
|
775 |
-
|
776 |
-
|
777 |
-
|
|
|
|
|
|
|
|
|
778 |
}else{
|
779 |
-
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').
|
780 |
-
}
|
781 |
}
|
782 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
783 |
}
|
784 |
|
785 |
function qmnUpdatePageNumber( amount, quiz_form_id ) {
|
@@ -812,8 +885,40 @@ function qmnInitPagination( quiz_id ) {
|
|
812 |
.append( '<a class="qmn_btn mlw_qmn_quiz_link mlw_previous" href="#">' + qmn_quiz_data[quiz_id].pagination.previous_text + '</a>' )
|
813 |
.append( '<span class="qmn_page_message"></span>' )
|
814 |
.append( '<div class="qmn_page_counter_message"></div>' )
|
|
|
815 |
.append( '<a class="qmn_btn mlw_qmn_quiz_link mlw_next" href="#">' + qmn_quiz_data[quiz_id].pagination.next_text + '</a>' );
|
816 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
817 |
jQuery(".mlw_next").click(function(event) {
|
818 |
event.preventDefault();
|
819 |
var quiz_id = +jQuery( this ).closest( '.qmn_quiz_container' ).find( '.qmn_quiz_id' ).val();
|
266 |
$quizForm.find( '.qsm-pagination' ).append( '<input type="hidden" value="0" name="current_page" class="current_page_hidden" />');
|
267 |
}
|
268 |
if ( '1' == qmn_quiz_data[ quizID ].progress_bar ) {
|
269 |
+
$('#quizForm' + quizID).find('.qsm-progress-bar').show();
|
270 |
+
qmn_quiz_data[ quizID ].bar = new ProgressBar.Line('#quizForm' + quizID + ' .qsm-progress-bar', {
|
271 |
strokeWidth: 2,
|
272 |
easing: 'easeInOut',
|
273 |
duration: 1400,
|
292 |
from: {color: '#3498db'},
|
293 |
to: {color: '#ED6A5A'},
|
294 |
step: function(state, bar) {
|
295 |
+
//bar.setText(Math.round(bar.value() * 100) + ' %');
|
296 |
}
|
297 |
});
|
298 |
}
|
300 |
$quizForm.find( '.qsm-pagination .qsm-next' ).on( 'click', function( event ) {
|
301 |
event.preventDefault();
|
302 |
QSM.nextPage( quizID );
|
303 |
+
var $container = jQuery( '#quizForm' + quizID ).closest( '.qmn_quiz_container' );
|
304 |
+
qsmScrollTo( $container );
|
305 |
});
|
306 |
$quizForm.find( '.qsm-pagination .qsm-previous' ).on( 'click', function( event ) {
|
307 |
event.preventDefault();
|
308 |
QSM.prevPage( quizID );
|
309 |
+
var $container = jQuery( '#quizForm' + quizID ).closest( '.qmn_quiz_container' );
|
310 |
+
qsmScrollTo( $container );
|
311 |
});
|
312 |
}
|
313 |
},
|
334 |
$quizForm.find( '.qsm-previous' ).show();
|
335 |
}
|
336 |
if ( '1' == qmn_quiz_data[ quizID ].progress_bar ) {
|
337 |
+
var current_page = jQuery('#quizForm' + quizID).find('.current_page_hidden').val();
|
338 |
+
var total_page_length = $pages.length - 1;
|
339 |
+
if( qmn_quiz_data[ quizID ].contact_info_location == 0 ){
|
340 |
+
//Do nothing.
|
341 |
+
}else if( qmn_quiz_data[ quizID ].contact_info_location == 1 ){
|
342 |
+
if($quizForm.children( '.qsm-page' ).find('.qsm_contact_div ').length > 0){
|
343 |
+
//total_page_length = total_page_length - 1;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
var animate_value = current_page / total_page_length;
|
347 |
+
if( animate_value <= 1){
|
348 |
+
qmn_quiz_data[ quizID ].bar.animate( animate_value );
|
349 |
+
var old_text = jQuery( '#quizForm' + quizID ).find( '.progressbar-text' ).text().replace(' %', '');
|
350 |
+
var new_text = Math.round(animate_value * 100);
|
351 |
+
jQuery({
|
352 |
+
Counter: old_text
|
353 |
+
}).animate({
|
354 |
+
Counter: new_text
|
355 |
+
}, {
|
356 |
+
duration: 1000,
|
357 |
+
easing: 'swing',
|
358 |
+
step: function () {
|
359 |
+
jQuery( '#quizForm' + quizID ).find( '.progressbar-text' ).text(Math.round(this.Counter) + ' %');
|
360 |
+
}
|
361 |
+
});
|
362 |
+
}
|
363 |
}
|
364 |
QSM.savePage( quizID, pageNumber );
|
365 |
},
|
741 |
var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
|
742 |
var total_page_number = Math.ceil(total_questions / pagination);
|
743 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
|
744 |
+
if(page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
|
745 |
+
if( page_number <= total_page_number ){
|
746 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + ' out of ' + total_page_number);
|
747 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
|
748 |
+
}else{
|
749 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
750 |
+
}
|
751 |
}else{
|
752 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
753 |
}
|
754 |
+
qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number);
|
755 |
}
|
756 |
|
757 |
function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
|
801 |
qsmScrollTo( $container );
|
802 |
}
|
803 |
var hiddem_page_number = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val();
|
804 |
+
var page_number = parseInt(hiddem_page_number) - 1;
|
805 |
+
var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
|
806 |
+
var total_page_number = Math.ceil(total_questions / pagination);
|
807 |
+
if(hiddem_page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
|
808 |
+
if( page_number <= total_page_number ){
|
809 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + ' out of ' + total_page_number);
|
810 |
+
if(page_number == 0){
|
811 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
812 |
+
}else{
|
813 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
|
814 |
+
}
|
815 |
}else{
|
816 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
817 |
+
}
|
818 |
}
|
819 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
|
820 |
+
qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number);
|
821 |
+
}
|
822 |
+
|
823 |
+
/**
|
824 |
+
* @since 6.4.11
|
825 |
+
* @param {int} quiz_id
|
826 |
+
* @param {int} page_number
|
827 |
+
* @param {int} total_page_number
|
828 |
+
* @returns Change progress bar on next and previous button click
|
829 |
+
*/
|
830 |
+
function qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number){
|
831 |
+
if ( '1' == qmn_quiz_data[ quiz_id ].progress_bar ) {
|
832 |
+
var total_questions = jQuery( '#quizForm' + quiz_id ).closest( '.qmn_quiz_container' ).find('.quiz_section').length - 1;
|
833 |
+
var pagination = qmn_quiz_data[quiz_id].pagination.amount;
|
834 |
+
total_page_number = Math.ceil(total_questions / pagination);
|
835 |
+
if(pagination === 1){
|
836 |
+
total_page_number = total_page_number - 1;
|
837 |
+
}
|
838 |
+
var animate_value = page_number / total_page_number;
|
839 |
+
if( animate_value <= 1){
|
840 |
+
qmn_quiz_data[ quiz_id ].bar.animate( animate_value );
|
841 |
+
var old_text = jQuery( '#qsm_progress_bar_' + quiz_id ).find( '.progressbar-text' ).text().replace(' %', '');
|
842 |
+
var new_text = Math.round(animate_value * 100);
|
843 |
+
jQuery({
|
844 |
+
Counter: old_text
|
845 |
+
}).animate({
|
846 |
+
Counter: new_text
|
847 |
+
}, {
|
848 |
+
duration: 1000,
|
849 |
+
easing: 'swing',
|
850 |
+
step: function () {
|
851 |
+
jQuery( '#qsm_progress_bar_' + quiz_id ).find( '.progressbar-text' ).text(Math.round(this.Counter) + ' %');
|
852 |
+
}
|
853 |
+
});
|
854 |
+
}
|
855 |
+
}
|
856 |
}
|
857 |
|
858 |
function qmnUpdatePageNumber( amount, quiz_form_id ) {
|
885 |
.append( '<a class="qmn_btn mlw_qmn_quiz_link mlw_previous" href="#">' + qmn_quiz_data[quiz_id].pagination.previous_text + '</a>' )
|
886 |
.append( '<span class="qmn_page_message"></span>' )
|
887 |
.append( '<div class="qmn_page_counter_message"></div>' )
|
888 |
+
.append( '<div class="qsm-progress-bar" id="qsm_progress_bar_'+ quiz_id +'" style="display:none;"><div class="progressbar-text"></div></div>' )
|
889 |
.append( '<a class="qmn_btn mlw_qmn_quiz_link mlw_next" href="#">' + qmn_quiz_data[quiz_id].pagination.next_text + '</a>' );
|
890 |
+
|
891 |
+
if ( '1' == qmn_quiz_data[ quiz_id ].progress_bar ) {
|
892 |
+
jQuery('#quizForm' + quiz_id).closest( '.qmn_quiz_container' ).find('.qsm-progress-bar').show();
|
893 |
+
qmn_quiz_data[ quiz_id ].bar = new ProgressBar.Line('#qsm_progress_bar_' + quiz_id, {
|
894 |
+
strokeWidth: 2,
|
895 |
+
easing: 'easeInOut',
|
896 |
+
duration: 500,
|
897 |
+
color: '#3498db',
|
898 |
+
trailColor: '#eee',
|
899 |
+
trailWidth: 1,
|
900 |
+
svgStyle: {width: '100%', height: '100%'},
|
901 |
+
text: {
|
902 |
+
style: {
|
903 |
+
// color: '#999',
|
904 |
+
position: 'absolute',
|
905 |
+
padding: 0,
|
906 |
+
margin: 0,
|
907 |
+
top: 0,
|
908 |
+
right: '10px',
|
909 |
+
'font-size': '13px',
|
910 |
+
'font-weight': 'bold',
|
911 |
+
transform: null
|
912 |
+
},
|
913 |
+
autoStyleContainer: false
|
914 |
+
},
|
915 |
+
from: {color: '#3498db'},
|
916 |
+
to: {color: '#ED6A5A'},
|
917 |
+
step: function(state, bar) {
|
918 |
+
}
|
919 |
+
});
|
920 |
+
}
|
921 |
+
|
922 |
jQuery(".mlw_next").click(function(event) {
|
923 |
event.preventDefault();
|
924 |
var quiz_id = +jQuery( this ).closest( '.qmn_quiz_container' ).find( '.qmn_quiz_id' ).val();
|
@@ -2,14 +2,14 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Quiz And Survey Master
|
4 |
* Description: Easily and quickly add quizzes and surveys to your website.
|
5 |
-
* Version: 6.4.
|
6 |
* Author: ExpressTech
|
7 |
* Author URI: https://quizandsurveymaster.com/
|
8 |
* Plugin URI: https://expresstech.io/
|
9 |
* Text Domain: quiz-master-next
|
10 |
*
|
11 |
* @author QSM Team
|
12 |
-
* @version 6.4.
|
13 |
* @package QSM
|
14 |
*/
|
15 |
|
@@ -37,7 +37,7 @@ class MLWQuizMasterNext {
|
|
37 |
* @var string
|
38 |
* @since 4.0.0
|
39 |
*/
|
40 |
-
public $version = '6.4.
|
41 |
|
42 |
/**
|
43 |
* QSM Alert Manager Object
|
2 |
/**
|
3 |
* Plugin Name: Quiz And Survey Master
|
4 |
* Description: Easily and quickly add quizzes and surveys to your website.
|
5 |
+
* Version: 6.4.11
|
6 |
* Author: ExpressTech
|
7 |
* Author URI: https://quizandsurveymaster.com/
|
8 |
* Plugin URI: https://expresstech.io/
|
9 |
* Text Domain: quiz-master-next
|
10 |
*
|
11 |
* @author QSM Team
|
12 |
+
* @version 6.4.11
|
13 |
* @package QSM
|
14 |
*/
|
15 |
|
37 |
* @var string
|
38 |
* @since 4.0.0
|
39 |
*/
|
40 |
+
public $version = '6.4.11';
|
41 |
|
42 |
/**
|
43 |
* QSM Alert Manager Object
|
@@ -26,36 +26,11 @@ function qsm_generate_about_page() {
|
|
26 |
}
|
27 |
</style>
|
28 |
<div class="wrap about-wrap">
|
29 |
-
<h1><?php esc_html_e( 'Welcome To Quiz And Survey Master (Formerly Quiz Master Next)', 'quiz-master-next' ); ?></h1>
|
30 |
-
<div class="about-text"><?php esc_html_e( 'Thank you for updating!', 'quiz-master-next' ); ?></div>
|
31 |
<div class="qsm_icon_wrap"><?php echo esc_html( $version ); ?></div>
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
<a href="#" data-tab='2' class="nav-tab qsm-tab">
|
36 |
-
<?php esc_html_e( 'Changelog', 'quiz-master-next' ); ?></a>
|
37 |
-
<a href="#" data-tab='3' class="nav-tab qsm-tab">
|
38 |
-
<?php esc_html_e( 'People Who Make QSM Possible', 'quiz-master-next' ); ?></a>
|
39 |
-
</h2>
|
40 |
-
<div class="qsm-tab-content tab-1">
|
41 |
-
<div class="feature">
|
42 |
-
<h2 class="feature-headline">Welcome to QSM 6.2!</h2>
|
43 |
-
</div>
|
44 |
-
<div class="feature">
|
45 |
-
<h2 class="feature-headline">New Email System</h2>
|
46 |
-
<p class="feature-text">All of the email system has been entirely re-written. The newer system is much more intuitive and allows for more granular conditions allowing us to add in more conditions types in future versions.</p>
|
47 |
-
</div>
|
48 |
-
<div class="feature">
|
49 |
-
<h2 class="feature-headline">New Results Page System</h2>
|
50 |
-
<p class="feature-text">All of the results page has been entirely re-written. The newer system is much more intuitive and allows for more granular conditions allowing us to add in more conditions types in future versions.</p>
|
51 |
-
</div>
|
52 |
-
</div>
|
53 |
-
<div class="qsm-tab-content tab-2" style="display: none;">
|
54 |
-
<h2>Changelog</h2>
|
55 |
-
<?php QSM_Changelog_Generator::get_changelog_list( 'QuizandSurveyMaster/quiz_master_next', 56 ); ?>
|
56 |
-
</div>
|
57 |
-
<div class="qsm-tab-content tab-3" style="display:none;">
|
58 |
-
<h2>GitHub Contributors</h2>
|
59 |
<?php
|
60 |
$contributors = get_transient( 'qmn_contributors' );
|
61 |
if ( false === $contributors ) {
|
26 |
}
|
27 |
</style>
|
28 |
<div class="wrap about-wrap">
|
29 |
+
<h1><?php esc_html_e( 'Welcome To Quiz And Survey Master (Formerly Quiz Master Next)', 'quiz-master-next' ); ?></h1>
|
|
|
30 |
<div class="qsm_icon_wrap"><?php echo esc_html( $version ); ?></div>
|
31 |
+
<hr>
|
32 |
+
<div class="qsm-tab-content tab-3" >
|
33 |
+
<h2 style="text-align: left;margin-bottom: 35px;margin-top: 25px;font-weight: 500;">GitHub Contributors</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<?php
|
35 |
$contributors = get_transient( 'qmn_contributors' );
|
36 |
if ( false === $contributors ) {
|
@@ -31,18 +31,20 @@ add_action('admin_init','qsm_add_author_column_in_db');
|
|
31 |
* Insert new column in quiz table
|
32 |
*/
|
33 |
function qsm_add_author_column_in_db(){
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
$
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
44 |
}
|
45 |
-
|
46 |
}
|
47 |
|
48 |
add_action('admin_init', 'qsm_change_the_post_type');
|
31 |
* Insert new column in quiz table
|
32 |
*/
|
33 |
function qsm_add_author_column_in_db(){
|
34 |
+
if( get_option('qsm_update_db_column', '') != '1' ){
|
35 |
+
global $wpdb;
|
36 |
+
$quiz_table_name = $wpdb->prefix . "mlw_quizzes";
|
37 |
+
$row = $wpdb->get_row("SELECT * FROM $quiz_table_name");
|
38 |
+
if (!isset($row->quiz_author_id)) {
|
39 |
+
$wpdb->query("ALTER TABLE $quiz_table_name ADD quiz_author_id INT NOT NULL");
|
40 |
+
}
|
41 |
+
$result_table_name = $wpdb->prefix . "mlw_results";
|
42 |
+
$row = $wpdb->get_row("SELECT * FROM $result_table_name");
|
43 |
+
if ( !isset($row->unique_id) ) {
|
44 |
+
$wpdb->query("ALTER TABLE $result_table_name ADD unique_id varchar(255) NOT NULL");
|
45 |
+
}
|
46 |
+
update_option('qsm_update_db_column', '1');
|
47 |
}
|
|
|
48 |
}
|
49 |
|
50 |
add_action('admin_init', 'qsm_change_the_post_type');
|
@@ -113,6 +113,9 @@ function qsm_options_emails_tab_content() {
|
|
113 |
<div class="template_variable">
|
114 |
<span class="template_name">%CURRENT_DATE%</span> - <?php _e('The Current Date', 'quiz-master-next'); ?>
|
115 |
</div>
|
|
|
|
|
|
|
116 |
<?php do_action('qmn_template_variable_list'); ?>
|
117 |
</div>
|
118 |
<div style="clear:both;"></div>
|
113 |
<div class="template_variable">
|
114 |
<span class="template_name">%CURRENT_DATE%</span> - <?php _e('The Current Date', 'quiz-master-next'); ?>
|
115 |
</div>
|
116 |
+
<div class="template_variable">
|
117 |
+
<span class="template_name">%QUESTION_ANSWER_X%</span> - <?php _e('X = Question ID. It will show result of particular question.', 'quiz-master-next'); ?>
|
118 |
+
</div>
|
119 |
<?php do_action('qmn_template_variable_list'); ?>
|
120 |
</div>
|
121 |
<div style="clear:both;"></div>
|
@@ -120,6 +120,9 @@ function qsm_options_results_tab_content() {
|
|
120 |
<div class="template_variable">
|
121 |
<span class="template_name">%RESULT_ID%</span> - <?php _e('Show result id', 'quiz-master-next'); ?>
|
122 |
</div>
|
|
|
|
|
|
|
123 |
<?php do_action('qmn_template_variable_list'); ?>
|
124 |
</div>
|
125 |
<div style="clear:both;"></div>
|
120 |
<div class="template_variable">
|
121 |
<span class="template_name">%RESULT_ID%</span> - <?php _e('Show result id', 'quiz-master-next'); ?>
|
122 |
</div>
|
123 |
+
<div class="template_variable">
|
124 |
+
<span class="template_name">%QUESTION_ANSWER_X%</span> - <?php _e('X = Question ID. It will show result of particular question.', 'quiz-master-next'); ?>
|
125 |
+
</div>
|
126 |
<?php do_action('qmn_template_variable_list'); ?>
|
127 |
</div>
|
128 |
<div style="clear:both;"></div>
|
@@ -268,6 +268,7 @@ class QMNQuizManager {
|
|
268 |
'disable_answer' => $qmn_quiz_options->disable_answer_onselect,
|
269 |
'ajax_show_correct' => $qmn_quiz_options->ajax_show_correct,
|
270 |
'progress_bar' => $qmn_quiz_options->progress_bar,
|
|
|
271 |
);
|
272 |
|
273 |
$return_display = apply_filters('qmn_begin_shortcode', $return_display, $qmn_quiz_options, $qmn_array_for_variables);
|
@@ -583,7 +584,7 @@ class QMNQuizManager {
|
|
583 |
$question_list = '';
|
584 |
$contact_fields = QSM_Contact_Manager::load_fields();
|
585 |
$animation_effect = isset($options->quiz_animation) && $options->quiz_animation != '' ? ' animated ' . $options->quiz_animation : '';
|
586 |
-
$enable_pagination_quiz = isset($options->enable_pagination_quiz) && $options->enable_pagination_quiz
|
587 |
if (count($pages) > 1 && (!empty($options->message_before) || ( 0 == $options->contact_info_location && $contact_fields ) )) {
|
588 |
$qmn_json_data['first_page'] = true;
|
589 |
$message_before = wpautop(htmlspecialchars_decode($options->message_before, ENT_QUOTES));
|
@@ -697,7 +698,7 @@ class QMNQuizManager {
|
|
697 |
?>
|
698 |
</div>
|
699 |
<?php
|
700 |
-
}
|
701 |
if($enable_pagination_quiz){
|
702 |
?>
|
703 |
<span class="pages_count">
|
@@ -752,7 +753,7 @@ class QMNQuizManager {
|
|
752 |
<a class="qsm-btn qsm-previous qmn_btn mlw_qmn_quiz_link mlw_previous" href="#"><?php echo esc_html($options->previous_button_text); ?></a>
|
753 |
<span class="qmn_page_message"></span>
|
754 |
<div class="qmn_page_counter_message"></div>
|
755 |
-
<div class="qsm-progress-bar" style="display:none;"></div>
|
756 |
<a class="qsm-btn qsm-next qmn_btn mlw_qmn_quiz_link mlw_next" href="#"><?php echo esc_html($options->next_button_text); ?></a>
|
757 |
<input type='submit' class='qsm-btn qsm-submit-btn qmn_btn' value='<?php echo esc_attr(htmlspecialchars_decode($options->submit_button_text, ENT_QUOTES)); ?>' />
|
758 |
</div>
|
@@ -1064,7 +1065,7 @@ class QMNQuizManager {
|
|
1064 |
|
1065 |
$result_display .= $this->display_social($qmn_quiz_options, $qmn_array_for_variables);
|
1066 |
$result_display = apply_filters('qmn_after_social_media', $result_display, $qmn_quiz_options, $qmn_array_for_variables);
|
1067 |
-
if (
|
1068 |
$result_display .= '<a style="float: right;" class="button btn-reload-quiz" data-quiz_id="'. $qmn_array_for_variables['quiz_id'] .'" href="#" >'. apply_filters('qsm_retake_quiz_text', 'Retake Quiz') .'</a>';
|
1069 |
}
|
1070 |
$unique_id = md5(date("Y-m-d H:i:s"));
|
@@ -1134,7 +1135,9 @@ class QMNQuizManager {
|
|
1134 |
// Hook is fired after the responses are submitted. Passes responses, result ID, quiz settings, and response data.
|
1135 |
do_action('qsm_quiz_submitted', $results_array, $results_id, $qmn_quiz_options, $qmn_array_for_variables);
|
1136 |
|
1137 |
-
|
|
|
|
|
1138 |
QSM_Emails::send_emails($qmn_array_for_variables);
|
1139 |
|
1140 |
/**
|
@@ -1676,7 +1679,39 @@ class QMNQuizManager {
|
|
1676 |
}
|
1677 |
return $ip;
|
1678 |
}
|
1679 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1680 |
}
|
1681 |
|
1682 |
global $qmnQuizManager;
|
268 |
'disable_answer' => $qmn_quiz_options->disable_answer_onselect,
|
269 |
'ajax_show_correct' => $qmn_quiz_options->ajax_show_correct,
|
270 |
'progress_bar' => $qmn_quiz_options->progress_bar,
|
271 |
+
'contact_info_location' => $qmn_quiz_options->contact_info_location,
|
272 |
);
|
273 |
|
274 |
$return_display = apply_filters('qmn_begin_shortcode', $return_display, $qmn_quiz_options, $qmn_array_for_variables);
|
584 |
$question_list = '';
|
585 |
$contact_fields = QSM_Contact_Manager::load_fields();
|
586 |
$animation_effect = isset($options->quiz_animation) && $options->quiz_animation != '' ? ' animated ' . $options->quiz_animation : '';
|
587 |
+
$enable_pagination_quiz = isset($options->enable_pagination_quiz) && $options->enable_pagination_quiz == 1 ? true : false;
|
588 |
if (count($pages) > 1 && (!empty($options->message_before) || ( 0 == $options->contact_info_location && $contact_fields ) )) {
|
589 |
$qmn_json_data['first_page'] = true;
|
590 |
$message_before = wpautop(htmlspecialchars_decode($options->message_before, ENT_QUOTES));
|
698 |
?>
|
699 |
</div>
|
700 |
<?php
|
701 |
+
}
|
702 |
if($enable_pagination_quiz){
|
703 |
?>
|
704 |
<span class="pages_count">
|
753 |
<a class="qsm-btn qsm-previous qmn_btn mlw_qmn_quiz_link mlw_previous" href="#"><?php echo esc_html($options->previous_button_text); ?></a>
|
754 |
<span class="qmn_page_message"></span>
|
755 |
<div class="qmn_page_counter_message"></div>
|
756 |
+
<div class="qsm-progress-bar" style="display:none;"><div class="progressbar-text"></div></div>
|
757 |
<a class="qsm-btn qsm-next qmn_btn mlw_qmn_quiz_link mlw_next" href="#"><?php echo esc_html($options->next_button_text); ?></a>
|
758 |
<input type='submit' class='qsm-btn qsm-submit-btn qmn_btn' value='<?php echo esc_attr(htmlspecialchars_decode($options->submit_button_text, ENT_QUOTES)); ?>' />
|
759 |
</div>
|
1065 |
|
1066 |
$result_display .= $this->display_social($qmn_quiz_options, $qmn_array_for_variables);
|
1067 |
$result_display = apply_filters('qmn_after_social_media', $result_display, $qmn_quiz_options, $qmn_array_for_variables);
|
1068 |
+
if ( $this->qsm_plugin_active( 'qsm-save-resume/qsm-save-resume.php' ) != 1 && $qmn_quiz_options->enable_retake_quiz_button == 1 ) {
|
1069 |
$result_display .= '<a style="float: right;" class="button btn-reload-quiz" data-quiz_id="'. $qmn_array_for_variables['quiz_id'] .'" href="#" >'. apply_filters('qsm_retake_quiz_text', 'Retake Quiz') .'</a>';
|
1070 |
}
|
1071 |
$unique_id = md5(date("Y-m-d H:i:s"));
|
1135 |
// Hook is fired after the responses are submitted. Passes responses, result ID, quiz settings, and response data.
|
1136 |
do_action('qsm_quiz_submitted', $results_array, $results_id, $qmn_quiz_options, $qmn_array_for_variables);
|
1137 |
|
1138 |
+
$qmn_array_for_variables = apply_filters( 'qmn_filter_email_content', $qmn_array_for_variables, $results_id);
|
1139 |
+
|
1140 |
+
// Sends the emails.
|
1141 |
QSM_Emails::send_emails($qmn_array_for_variables);
|
1142 |
|
1143 |
/**
|
1679 |
}
|
1680 |
return $ip;
|
1681 |
}
|
1682 |
+
|
1683 |
+
/**
|
1684 |
+
* Determines whether a plugin is active.
|
1685 |
+
*
|
1686 |
+
* @since 6.4.11
|
1687 |
+
*
|
1688 |
+
* @param string $plugin Path to the plugin file relative to the plugins directory.
|
1689 |
+
* @return bool True, if in the active plugins list. False, not in the list.
|
1690 |
+
*/
|
1691 |
+
private function qsm_plugin_active( $plugin ){
|
1692 |
+
return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || $this->qsm_plugin_active_for_network( $plugin );
|
1693 |
+
}
|
1694 |
+
|
1695 |
+
/**
|
1696 |
+
* Determines whether the plugin is active for the entire network.
|
1697 |
+
*
|
1698 |
+
* @since 6.4.11
|
1699 |
+
*
|
1700 |
+
* @param string $plugin Path to the plugin file relative to the plugins directory.
|
1701 |
+
* @return bool True if active for the network, otherwise false.
|
1702 |
+
*/
|
1703 |
+
private function qsm_plugin_active_for_network(){
|
1704 |
+
if ( ! is_multisite() ) {
|
1705 |
+
return false;
|
1706 |
+
}
|
1707 |
+
|
1708 |
+
$plugins = get_site_option( 'active_sitewide_plugins' );
|
1709 |
+
if ( isset( $plugins[ $plugin ] ) ) {
|
1710 |
+
return true;
|
1711 |
+
}
|
1712 |
+
|
1713 |
+
return false;
|
1714 |
+
}
|
1715 |
}
|
1716 |
|
1717 |
global $qmnQuizManager;
|
@@ -261,7 +261,7 @@ class QSM_Questions {
|
|
261 |
|
262 |
$values = array(
|
263 |
'quiz_id' => intval( $data['quiz_id'] ),
|
264 |
-
'question_name' => trim( preg_replace( '/\s+/', ' ', htmlspecialchars(
|
265 |
'answer_array' => serialize( $answers ),
|
266 |
'question_answer_info' => htmlspecialchars( $data['answer_info'], ENT_QUOTES ),
|
267 |
'comments' => htmlspecialchars( $data['comments'], ENT_QUOTES ),
|
261 |
|
262 |
$values = array(
|
263 |
'quiz_id' => intval( $data['quiz_id'] ),
|
264 |
+
'question_name' => trim( preg_replace( '/\s+/', ' ', htmlspecialchars( wp_kses_post( $data['name'] ), ENT_QUOTES ) ) ),
|
265 |
'answer_array' => serialize( $answers ),
|
266 |
'question_answer_info' => htmlspecialchars( $data['answer_info'], ENT_QUOTES ),
|
267 |
'comments' => htmlspecialchars( $data['comments'], ENT_QUOTES ),
|
@@ -153,7 +153,7 @@ function qmn_multiple_choice_review($id, $question, $answers)
|
|
153 |
} else {
|
154 |
$mlw_user_answer = " ";
|
155 |
}
|
156 |
-
$return_array['user_text'] =
|
157 |
foreach($answers as $answer)
|
158 |
{
|
159 |
if ( $mlw_user_answer == trim( esc_attr( $answer[0] ) ) )
|
153 |
} else {
|
154 |
$mlw_user_answer = " ";
|
155 |
}
|
156 |
+
$return_array['user_text'] = stripslashes( htmlspecialchars_decode($mlw_user_answer, ENT_QUOTES) );
|
157 |
foreach($answers as $answer)
|
158 |
{
|
159 |
if ( $mlw_user_answer == trim( esc_attr( $answer[0] ) ) )
|
@@ -189,29 +189,6 @@ function qsm_generate_fb_header_metadata() {
|
|
189 |
add_action('wp_head', 'qsm_generate_fb_header_metadata');
|
190 |
|
191 |
|
192 |
-
add_action('wp_head', 'qsm_check_script_error');
|
193 |
-
/**
|
194 |
-
* @since 6.4.8
|
195 |
-
* Show the JS error
|
196 |
-
*/
|
197 |
-
function qsm_check_script_error() {
|
198 |
-
if (is_singular('qsm_quiz') && is_user_logged_in() && current_user_can('administrator')) {
|
199 |
-
?>
|
200 |
-
<script src="<?php echo QSM_PLUGIN_URL . 'js/show-js-error.custom.js'; ?>"></script>
|
201 |
-
<link rel='stylesheet' href='<?php echo QSM_PLUGIN_URL . 'css/show-js-error.css'; ?>' type='text/css' media='all' />
|
202 |
-
<script>
|
203 |
-
//Display JS error
|
204 |
-
showJSError.init({
|
205 |
-
title: 'Javascript error detected by QSM Plugin. Try deactivating other plugins and themes. If the error still persists, please report the same on our support forums',
|
206 |
-
copyText: 'Copy to clipboard',
|
207 |
-
userAgent: navigator.userAgent,
|
208 |
-
helpLinks: true
|
209 |
-
});
|
210 |
-
</script>
|
211 |
-
<?php
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
/**
|
216 |
* @since QSM 6.4.6
|
217 |
* @param int $quiz_id
|
189 |
add_action('wp_head', 'qsm_generate_fb_header_metadata');
|
190 |
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
/**
|
193 |
* @since QSM 6.4.6
|
194 |
* @param int $quiz_id
|
@@ -58,12 +58,63 @@ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_date_take
|
|
58 |
add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_facebook_share',10,2);
|
59 |
add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_twitter_share',10,2);
|
60 |
add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_result_id',10,2);
|
|
|
61 |
add_filter('qmn_end_results', 'qsm_variable_poll_result',10,3);
|
62 |
|
63 |
add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
|
64 |
add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_date',10,2);
|
65 |
add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_current_user',10,2);
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
/**
|
68 |
* Show poll result
|
69 |
* @param str $content
|
@@ -73,6 +124,10 @@ function qsm_variable_poll_result($content, $mlw_quiz_array, $variables){
|
|
73 |
$quiz_id = is_object($mlw_quiz_array) ? $mlw_quiz_array->quiz_id : $mlw_quiz_array['quiz_id'];
|
74 |
while ( false !== strpos($content, '%POLL_RESULTS_') ) {
|
75 |
$question_id = mlw_qmn_get_string_between($content, '%POLL_RESULTS_', '%');
|
|
|
|
|
|
|
|
|
76 |
global $wpdb;
|
77 |
$table_name = $wpdb->prefix . 'mlw_results';
|
78 |
$table_question = $wpdb->prefix . 'mlw_questions';
|
@@ -310,6 +365,7 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
|
|
310 |
}
|
311 |
$mlw_question_answer_display = htmlspecialchars_decode($qmn_question_answer_template, ENT_QUOTES);
|
312 |
$mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer[0], ENT_QUOTES) . '</b>', $mlw_question_answer_display);
|
|
|
313 |
if($answer['question_type'] == 11){
|
314 |
$file_extension = substr($answer[1], -4);
|
315 |
if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
|
58 |
add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_facebook_share',10,2);
|
59 |
add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_twitter_share',10,2);
|
60 |
add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_result_id',10,2);
|
61 |
+
add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_single_question_answer',10,2);
|
62 |
add_filter('qmn_end_results', 'qsm_variable_poll_result',10,3);
|
63 |
|
64 |
add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
|
65 |
add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_date',10,2);
|
66 |
add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_current_user',10,2);
|
67 |
|
68 |
+
/**
|
69 |
+
* @since 6.4.11
|
70 |
+
* @param str $content
|
71 |
+
* @param array $mlw_quiz_array
|
72 |
+
* Show particular question answer.
|
73 |
+
*/
|
74 |
+
function qsm_variable_single_question_answer( $content, $mlw_quiz_array ){
|
75 |
+
$quiz_id = is_object($mlw_quiz_array) ? $mlw_quiz_array->quiz_id : $mlw_quiz_array['quiz_id'];
|
76 |
+
while ( false !== strpos($content, '%QUESTION_ANSWER_') ) {
|
77 |
+
$question_id = mlw_qmn_get_string_between($content, '%QUESTION_ANSWER_', '%');
|
78 |
+
if( $question_id === 'X'){
|
79 |
+
$content = str_replace( "%QUESTION_ANSWER_". $question_id ."%" , '', $content);
|
80 |
+
return $content;
|
81 |
+
}
|
82 |
+
$question_answers_array = isset($mlw_quiz_array['question_answers_array']) ? $mlw_quiz_array['question_answers_array'] : array();
|
83 |
+
$key = array_search( $question_id, array_column($question_answers_array, 'id'));
|
84 |
+
if( isset($question_answers_array[$key]) ){
|
85 |
+
global $mlwQuizMasterNext;
|
86 |
+
$answer = $question_answers_array[$key];
|
87 |
+
$qmn_question_answer_template = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'question_answer_template', '%QUESTION%<br/>Answer Provided: %USER_ANSWER%<br/>Correct Answer: %CORRECT_ANSWER%<br/>Comments Entered: %USER_COMMENTS%' );
|
88 |
+
if ( $answer["correct"] === "correct" ){
|
89 |
+
$user_answer_class = "qmn_user_correct_answer";
|
90 |
+
$question_answer_class = "qmn_question_answer_correct";
|
91 |
+
} else {
|
92 |
+
$user_answer_class = "qmn_user_incorrect_answer";
|
93 |
+
$question_answer_class = "qmn_question_answer_incorrect";
|
94 |
+
}
|
95 |
+
$mlw_question_answer_display = htmlspecialchars_decode($qmn_question_answer_template, ENT_QUOTES);
|
96 |
+
$mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer[0], ENT_QUOTES) . '</b>', $mlw_question_answer_display);
|
97 |
+
$mlw_question_answer_display = qsm_question_title_func($mlw_question_answer_display);
|
98 |
+
if($answer['question_type'] == 11){
|
99 |
+
$file_extension = substr($answer[1], -4);
|
100 |
+
if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
|
101 |
+
$mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'><img src='$answer[1]'/></span>", $mlw_question_answer_display);
|
102 |
+
}else{
|
103 |
+
$mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'>".trim( htmlspecialchars_decode($answer[1], ENT_QUOTES) ).'</span>', $mlw_question_answer_display);
|
104 |
+
}
|
105 |
+
}else{
|
106 |
+
$mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'>".htmlspecialchars_decode($answer[1], ENT_QUOTES).'</span>', $mlw_question_answer_display);
|
107 |
+
}
|
108 |
+
$mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , htmlspecialchars_decode($answer[2], ENT_QUOTES), $mlw_question_answer_display);
|
109 |
+
$mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $answer[3], $mlw_question_answer_display);
|
110 |
+
$mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($qmn_questions[$answer['id']], ENT_QUOTES), $mlw_question_answer_display);
|
111 |
+
$display = "<div class='qmn_question_answer $question_answer_class'>".apply_filters('qmn_variable_question_answers', $mlw_question_answer_display, $mlw_quiz_array).'</div>';
|
112 |
+
$content = str_replace( "%QUESTION_ANSWER_". $question_id ."%" , $display, $content);
|
113 |
+
}
|
114 |
+
}
|
115 |
+
return $content;
|
116 |
+
}
|
117 |
+
|
118 |
/**
|
119 |
* Show poll result
|
120 |
* @param str $content
|
124 |
$quiz_id = is_object($mlw_quiz_array) ? $mlw_quiz_array->quiz_id : $mlw_quiz_array['quiz_id'];
|
125 |
while ( false !== strpos($content, '%POLL_RESULTS_') ) {
|
126 |
$question_id = mlw_qmn_get_string_between($content, '%POLL_RESULTS_', '%');
|
127 |
+
if( $question_id === 'X'){
|
128 |
+
$content = str_replace( "%POLL_RESULTS_". $question_id ."%" , '', $content);
|
129 |
+
return $content;
|
130 |
+
}
|
131 |
global $wpdb;
|
132 |
$table_name = $wpdb->prefix . 'mlw_results';
|
133 |
$table_question = $wpdb->prefix . 'mlw_questions';
|
365 |
}
|
366 |
$mlw_question_answer_display = htmlspecialchars_decode($qmn_question_answer_template, ENT_QUOTES);
|
367 |
$mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer[0], ENT_QUOTES) . '</b>', $mlw_question_answer_display);
|
368 |
+
$mlw_question_answer_display = qsm_question_title_func($mlw_question_answer_display);
|
369 |
if($answer['question_type'] == 11){
|
370 |
$file_extension = substr($answer[1], -4);
|
371 |
if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
|
@@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress q
|
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.4
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 6.4.
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -121,6 +121,19 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
|
|
121 |
|
122 |
== Changelog ==
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
= 6.4.10 (May 05, 2020) =
|
125 |
* Bug: Fixed issue while using quotes in CSS (https://github.com/QuizandSurveyMaster/quiz_master_next/issues/874).
|
126 |
* Bug: Fixed issue where text label overrides checkbox.
|
@@ -129,17 +142,17 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
|
|
129 |
* Bug: Fixed issue with latex syntax on result page.
|
130 |
* Enhancement: Added pagination while importing questions from question bank to increase performance
|
131 |
|
132 |
-
= 6.4.9 (April 21, 2020)=
|
133 |
* Bug: Fixed popup design issues.
|
134 |
|
135 |
-
= 6.4.8 (April 20, 2020)=
|
136 |
* Bug: Changed the quiz post type slug to solve the conflict with LMS plugin
|
137 |
* Feature: Added the button to remove the result data permanent
|
138 |
* Feature: Added supporting code for new advanced timer
|
139 |
* Feature: Option to select categories for random questions
|
140 |
* Enhancement: JavaScript error messages will show up only for WordPress admins.
|
141 |
|
142 |
-
= 6.4.7 (April 07, 2020)=
|
143 |
* Bug: Solved jquery UI error
|
144 |
* Bug: Customized text using the "Text tab" and remove from "Options Tab" for user is not logged in
|
145 |
* Bug: Fixed share Quizz's results on Social Media ( https://wordpress.org/support/topic/sharing-to-social-media/ )
|
@@ -150,7 +163,7 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
|
|
150 |
* Feature: Added Show JS Error library to show the JS Error in quiz page
|
151 |
* Feature: Changed type of quiz_results to MEDIUMTEXT (16M size) ( https://github.com/QuizandSurveyMaster/quiz_master_next/issues/522 )
|
152 |
|
153 |
-
= 6.4.5 (March 16, 2020)=
|
154 |
* Bug: Hint not readable
|
155 |
* Bug: Full html of the option is being output in the ID of wrapper div and in the value of the option ( https://github.com/QuizandSurveyMaster/quiz_master_next/issues/849 )
|
156 |
* Bug: QSM not picking up user select answer when empty spaces at the end
|
@@ -158,13 +171,13 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
|
|
158 |
* Feature: Take to quiz edit after creating a new quiz
|
159 |
* Feature: added 'deselect answer' button for multiple choice and horizontal multiple choice question type
|
160 |
|
161 |
-
= 6.4.4 (Feb 24, 2020)=
|
162 |
* Bug: Security Issues reported by WORDFENCE
|
163 |
* Bug: Change text in Get a Free Addon page
|
164 |
* Feature: Change sendy to sendinblue in free addon page
|
165 |
* Feature: Added sorting functionality on name and last activity
|
166 |
|
167 |
-
= 6.4.3 (Feb 6, 2020)=
|
168 |
* Bug: Solved user limit issue with ip address
|
169 |
* Bug: Solved Search input issue on Quizzes/Surveys
|
170 |
* Added: added question type help link and changed the old documentation in whole plugin
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.4
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 6.4.11
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
121 |
|
122 |
== Changelog ==
|
123 |
|
124 |
+
= 6.4.11 (May 22, 2020) =
|
125 |
+
* Bug: Removed static data from about us page.
|
126 |
+
* Bug: Fixed progress bar JS error and its calculation issues.
|
127 |
+
* Bug: Fixed issue with spaces before tables in questions.
|
128 |
+
* Bug: Fixed scroll to top issue for pagination.
|
129 |
+
* Bug: Fixed incorrect calculation with %AMOUNT_CORRECT% and %POINT_SCORE% variables.
|
130 |
+
* Bug: Removed unnecessary query repetitions.
|
131 |
+
* Enhancement: Added filter to add additional data to email content.
|
132 |
+
* Enhancement: Trim white space at the end of text answers.
|
133 |
+
* Enhancement: Created new function to check whether plugin is activated or not (https://wordpress.org/support/topic/error-on-submitting-quiz/#post-12821263)
|
134 |
+
* Enhancement: Added progress bar support for options tab pagination.
|
135 |
+
* Enhancement: Added new variable %QUESTION_ANSWER_X% to show specific question’s answer.
|
136 |
+
|
137 |
= 6.4.10 (May 05, 2020) =
|
138 |
* Bug: Fixed issue while using quotes in CSS (https://github.com/QuizandSurveyMaster/quiz_master_next/issues/874).
|
139 |
* Bug: Fixed issue where text label overrides checkbox.
|
142 |
* Bug: Fixed issue with latex syntax on result page.
|
143 |
* Enhancement: Added pagination while importing questions from question bank to increase performance
|
144 |
|
145 |
+
= 6.4.9 (April 21, 2020) =
|
146 |
* Bug: Fixed popup design issues.
|
147 |
|
148 |
+
= 6.4.8 (April 20, 2020) =
|
149 |
* Bug: Changed the quiz post type slug to solve the conflict with LMS plugin
|
150 |
* Feature: Added the button to remove the result data permanent
|
151 |
* Feature: Added supporting code for new advanced timer
|
152 |
* Feature: Option to select categories for random questions
|
153 |
* Enhancement: JavaScript error messages will show up only for WordPress admins.
|
154 |
|
155 |
+
= 6.4.7 (April 07, 2020) =
|
156 |
* Bug: Solved jquery UI error
|
157 |
* Bug: Customized text using the "Text tab" and remove from "Options Tab" for user is not logged in
|
158 |
* Bug: Fixed share Quizz's results on Social Media ( https://wordpress.org/support/topic/sharing-to-social-media/ )
|
163 |
* Feature: Added Show JS Error library to show the JS Error in quiz page
|
164 |
* Feature: Changed type of quiz_results to MEDIUMTEXT (16M size) ( https://github.com/QuizandSurveyMaster/quiz_master_next/issues/522 )
|
165 |
|
166 |
+
= 6.4.5 (March 16, 2020) =
|
167 |
* Bug: Hint not readable
|
168 |
* Bug: Full html of the option is being output in the ID of wrapper div and in the value of the option ( https://github.com/QuizandSurveyMaster/quiz_master_next/issues/849 )
|
169 |
* Bug: QSM not picking up user select answer when empty spaces at the end
|
171 |
* Feature: Take to quiz edit after creating a new quiz
|
172 |
* Feature: added 'deselect answer' button for multiple choice and horizontal multiple choice question type
|
173 |
|
174 |
+
= 6.4.4 (Feb 24, 2020) =
|
175 |
* Bug: Security Issues reported by WORDFENCE
|
176 |
* Bug: Change text in Get a Free Addon page
|
177 |
* Feature: Change sendy to sendinblue in free addon page
|
178 |
* Feature: Added sorting functionality on name and last activity
|
179 |
|
180 |
+
= 6.4.3 (Feb 6, 2020) =
|
181 |
* Bug: Solved user limit issue with ip address
|
182 |
* Bug: Solved Search input issue on Quizzes/Surveys
|
183 |
* Added: added question type help link and changed the old documentation in whole plugin
|
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
1 |
+
.qsm-progress-bar {
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
1 |
+
.qsm-progress-bar {
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
1 |
+
.qsm-progress-bar {
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
1 |
+
.qsm-progress-bar {
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
1 |
+
.qsm-progress-bar {
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
1 |
+
.qsm-progress-bar {
|
2 |
position: relative;
|
3 |
flex-grow: 2;
|
4 |
padding: 0 10px;
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Inherited Methods
|
6 |
+
* @method void wantToTest($text)
|
7 |
+
* @method void wantTo($text)
|
8 |
+
* @method void execute($callable)
|
9 |
+
* @method void expectTo($prediction)
|
10 |
+
* @method void expect($prediction)
|
11 |
+
* @method void amGoingTo($argumentation)
|
12 |
+
* @method void am($role)
|
13 |
+
* @method void lookForwardTo($achieveValue)
|
14 |
+
* @method void comment($description)
|
15 |
+
* @method void pause()
|
16 |
+
*
|
17 |
+
* @SuppressWarnings(PHPMD)
|
18 |
+
*/
|
19 |
+
class AcceptanceTester extends \Codeception\Actor
|
20 |
+
{
|
21 |
+
use _generated\AcceptanceTesterActions;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Define custom actions here
|
25 |
+
*/
|
26 |
+
}
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Inherited Methods
|
6 |
+
* @method void wantToTest($text)
|
7 |
+
* @method void wantTo($text)
|
8 |
+
* @method void execute($callable)
|
9 |
+
* @method void expectTo($prediction)
|
10 |
+
* @method void expect($prediction)
|
11 |
+
* @method void amGoingTo($argumentation)
|
12 |
+
* @method void am($role)
|
13 |
+
* @method void lookForwardTo($achieveValue)
|
14 |
+
* @method void comment($description)
|
15 |
+
* @method void pause()
|
16 |
+
*
|
17 |
+
* @SuppressWarnings(PHPMD)
|
18 |
+
*/
|
19 |
+
class FunctionalTester extends \Codeception\Actor
|
20 |
+
{
|
21 |
+
use _generated\FunctionalTesterActions;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Define custom actions here
|
25 |
+
*/
|
26 |
+
}
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Helper;
|
3 |
+
|
4 |
+
// here you can define custom actions
|
5 |
+
// all public methods declared in helper class will be available in $I
|
6 |
+
|
7 |
+
class Acceptance extends \Codeception\Module
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Helper;
|
3 |
+
|
4 |
+
// here you can define custom actions
|
5 |
+
// all public methods declared in helper class will be available in $I
|
6 |
+
|
7 |
+
class Functional extends \Codeception\Module
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Helper;
|
3 |
+
|
4 |
+
// here you can define custom actions
|
5 |
+
// all public methods declared in helper class will be available in $I
|
6 |
+
|
7 |
+
class Unit extends \Codeception\Module
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Helper;
|
3 |
+
|
4 |
+
// here you can define custom actions
|
5 |
+
// all public methods declared in helper class will be available in $I
|
6 |
+
|
7 |
+
class Wpunit extends \Codeception\Module
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Inherited Methods
|
6 |
+
* @method void wantToTest($text)
|
7 |
+
* @method void wantTo($text)
|
8 |
+
* @method void execute($callable)
|
9 |
+
* @method void expectTo($prediction)
|
10 |
+
* @method void expect($prediction)
|
11 |
+
* @method void amGoingTo($argumentation)
|
12 |
+
* @method void am($role)
|
13 |
+
* @method void lookForwardTo($achieveValue)
|
14 |
+
* @method void comment($description)
|
15 |
+
* @method void pause()
|
16 |
+
*
|
17 |
+
* @SuppressWarnings(PHPMD)
|
18 |
+
*/
|
19 |
+
class UnitTester extends \Codeception\Actor
|
20 |
+
{
|
21 |
+
use _generated\UnitTesterActions;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Define custom actions here
|
25 |
+
*/
|
26 |
+
}
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Inherited Methods
|
6 |
+
* @method void wantToTest($text)
|
7 |
+
* @method void wantTo($text)
|
8 |
+
* @method void execute($callable)
|
9 |
+
* @method void expectTo($prediction)
|
10 |
+
* @method void expect($prediction)
|
11 |
+
* @method void amGoingTo($argumentation)
|
12 |
+
* @method void am($role)
|
13 |
+
* @method void lookForwardTo($achieveValue)
|
14 |
+
* @method void comment($description)
|
15 |
+
* @method void pause()
|
16 |
+
*
|
17 |
+
* @SuppressWarnings(PHPMD)
|
18 |
+
*/
|
19 |
+
class WpunitTester extends \Codeception\Actor
|
20 |
+
{
|
21 |
+
use _generated\WpunitTesterActions;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Define custom actions here
|
25 |
+
*/
|
26 |
+
}
|
@@ -0,0 +1,3702 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //[STAMP] 50cc10c256c1649151a807e0f3000a41
|
2 |
+
namespace _generated;
|
3 |
+
|
4 |
+
// This class was automatically generated by build task
|
5 |
+
// You should not change it manually as it will be overwritten on next build
|
6 |
+
// @codingStandardsIgnoreFile
|
7 |
+
|
8 |
+
trait AcceptanceTesterActions
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* @return \Codeception\Scenario
|
12 |
+
*/
|
13 |
+
abstract protected function getScenario();
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
18 |
+
*
|
19 |
+
* Login as the administrator user using the credentials specified in the module configuration.
|
20 |
+
*
|
21 |
+
* The method will **not** follow redirection, after the login, to any page.
|
22 |
+
*
|
23 |
+
* @example
|
24 |
+
* ```php
|
25 |
+
* $I->loginAsAdmin();
|
26 |
+
* $I->amOnAdminPage('/');
|
27 |
+
* $I->see('Dashboard');
|
28 |
+
* ```
|
29 |
+
*
|
30 |
+
* @param int $timeout The max time, in seconds, to try to login.
|
31 |
+
* @param int $maxAttempts The max number of attempts to try to login.
|
32 |
+
*
|
33 |
+
* @throws \Codeception\Exception\ModuleException If all the attempts of obtaining the cookie fail.
|
34 |
+
* @see \Codeception\Module\WPWebDriver::loginAsAdmin()
|
35 |
+
*/
|
36 |
+
public function loginAsAdmin($timeout = null, $maxAttempts = null) {
|
37 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('loginAsAdmin', func_get_args()));
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
43 |
+
*
|
44 |
+
* Login as the specified user.
|
45 |
+
*
|
46 |
+
* The method will **not** follow redirection, after the login, to any page.
|
47 |
+
* Depending on the driven browser the login might be "too fast" and the server might have not
|
48 |
+
* replied with valid cookies yet; in that case the method will re-attempt the login to obtain
|
49 |
+
* the cookies.
|
50 |
+
* @example
|
51 |
+
* ```php
|
52 |
+
* $I->loginAs('user', 'password');
|
53 |
+
* $I->amOnAdminPage('/');
|
54 |
+
* $I->see('Dashboard');
|
55 |
+
* ```
|
56 |
+
*
|
57 |
+
* @param string $username The user login name.
|
58 |
+
* @param string $password The user password in plain text.
|
59 |
+
* @param int $timeout The max time, in seconds, to try to login.
|
60 |
+
* @param int $maxAttempts The max number of attempts to try to login.
|
61 |
+
*
|
62 |
+
* @throws \Codeception\Exception\ModuleException If all the attempts of obtaining the cookie fail.
|
63 |
+
* @see \Codeception\Module\WPWebDriver::loginAs()
|
64 |
+
*/
|
65 |
+
public function loginAs($username, $password, $timeout = null, $maxAttempts = null) {
|
66 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('loginAs', func_get_args()));
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
72 |
+
*
|
73 |
+
* Returns all the cookies whose name matches a regex pattern.
|
74 |
+
*
|
75 |
+
* @example
|
76 |
+
* ```php
|
77 |
+
* $I->loginAs('customer','password');
|
78 |
+
* $I->amOnPage('/shop');
|
79 |
+
* $cartCookies = $I->grabCookiesWithPattern("#^shop_cart\\.*#");
|
80 |
+
* ```
|
81 |
+
*
|
82 |
+
* @param string $cookiePattern The regular expression pattern to use for the matching.
|
83 |
+
*
|
84 |
+
* @return array|null An array of cookies matching the pattern.
|
85 |
+
* @see \Codeception\Module\WPWebDriver::grabCookiesWithPattern()
|
86 |
+
*/
|
87 |
+
public function grabCookiesWithPattern($cookiePattern) {
|
88 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookiesWithPattern', func_get_args()));
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
/**
|
93 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
94 |
+
*
|
95 |
+
* Waits for any jQuery triggered AJAX request to be resolved.
|
96 |
+
*
|
97 |
+
* @example
|
98 |
+
* ```php
|
99 |
+
* $I->amOnPage('/triggering-ajax-requests');
|
100 |
+
* $I->waitForJqueryAjax();
|
101 |
+
* $I->see('From AJAX');
|
102 |
+
* ```
|
103 |
+
*
|
104 |
+
* @param int $time The max time to wait for AJAX requests to complete.
|
105 |
+
* @see \Codeception\Module\WPWebDriver::waitForJqueryAjax()
|
106 |
+
*/
|
107 |
+
public function waitForJqueryAjax($time = null) {
|
108 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForJqueryAjax', func_get_args()));
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
/**
|
113 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
114 |
+
*
|
115 |
+
* Grabs the current page full URL including the query vars.
|
116 |
+
*
|
117 |
+
* @example
|
118 |
+
* ```php
|
119 |
+
* $today = date('Y-m-d');
|
120 |
+
* $I->amOnPage('/concerts?date=' . $today);
|
121 |
+
* $I->assertRegExp('#\\/concerts$#', $I->grabFullUrl());
|
122 |
+
* ```
|
123 |
+
* @see \Codeception\Module\WPWebDriver::grabFullUrl()
|
124 |
+
*/
|
125 |
+
public function grabFullUrl() {
|
126 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFullUrl', func_get_args()));
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
/**
|
131 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
132 |
+
*
|
133 |
+
* In the plugin administration screen deactivate a plugin clicking the "Deactivate" link.
|
134 |
+
*
|
135 |
+
* The method will **not** handle authentication and navigation to the plugins administration page.
|
136 |
+
*
|
137 |
+
* @example
|
138 |
+
* ```php
|
139 |
+
* // Deactivate one plugin.
|
140 |
+
* $I->loginAsAdmin();
|
141 |
+
* $I->amOnPluginsPage();
|
142 |
+
* $I->deactivatePlugin('hello-dolly');
|
143 |
+
* // Deactivate a list of plugins.
|
144 |
+
* $I->loginAsAdmin();
|
145 |
+
* $I->amOnPluginsPage();
|
146 |
+
* $I->deactivatePlugin(['hello-dolly', 'my-plugin']);
|
147 |
+
* ```
|
148 |
+
*
|
149 |
+
* @param string|array $pluginSlug The plugin slug, like "hello-dolly", or a list of plugin slugs.
|
150 |
+
* @see \Codeception\Module\WPWebDriver::deactivatePlugin()
|
151 |
+
*/
|
152 |
+
public function deactivatePlugin($pluginSlug) {
|
153 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('deactivatePlugin', func_get_args()));
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
/**
|
158 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
159 |
+
*
|
160 |
+
* In the plugin administration screen activates one or more plugins clicking the "Activate" link.
|
161 |
+
*
|
162 |
+
* The method will **not** handle authentication and navigation to the plugins administration page.
|
163 |
+
*
|
164 |
+
* @example
|
165 |
+
* ```php
|
166 |
+
* // Activate a plugin.
|
167 |
+
* $I->loginAsAdmin();
|
168 |
+
* $I->amOnPluginsPage();
|
169 |
+
* $I->activatePlugin('hello-dolly');
|
170 |
+
* // Activate a list of plugins.
|
171 |
+
* $I->loginAsAdmin();
|
172 |
+
* $I->amOnPluginsPage();
|
173 |
+
* $I->activatePlugin(['hello-dolly','another-plugin']);
|
174 |
+
* ```
|
175 |
+
*
|
176 |
+
* @param string|array $pluginSlug The plugin slug, like "hello-dolly" or a list of plugin slugs.
|
177 |
+
* @see \Codeception\Module\WPWebDriver::activatePlugin()
|
178 |
+
*/
|
179 |
+
public function activatePlugin($pluginSlug) {
|
180 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('activatePlugin', func_get_args()));
|
181 |
+
}
|
182 |
+
|
183 |
+
|
184 |
+
/**
|
185 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
186 |
+
*
|
187 |
+
* Print out latest Selenium Logs in debug mode
|
188 |
+
*
|
189 |
+
* @param \Codeception\TestInterface $test
|
190 |
+
* @see \Codeception\Module\WebDriver::debugWebDriverLogs()
|
191 |
+
*/
|
192 |
+
public function debugWebDriverLogs($test = null) {
|
193 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('debugWebDriverLogs', func_get_args()));
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
/**
|
198 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
199 |
+
*
|
200 |
+
* Changes the subdomain for the 'url' configuration parameter.
|
201 |
+
* Does not open a page; use `amOnPage` for that.
|
202 |
+
*
|
203 |
+
* ``` php
|
204 |
+
* <?php
|
205 |
+
* // If config is: 'http://mysite.com'
|
206 |
+
* // or config is: 'http://www.mysite.com'
|
207 |
+
* // or config is: 'http://company.mysite.com'
|
208 |
+
*
|
209 |
+
* $I->amOnSubdomain('user');
|
210 |
+
* $I->amOnPage('/');
|
211 |
+
* // moves to http://user.mysite.com/
|
212 |
+
* ?>
|
213 |
+
* ```
|
214 |
+
*
|
215 |
+
* @param $subdomain
|
216 |
+
*
|
217 |
+
* @return mixed
|
218 |
+
* @see \Codeception\Module\WebDriver::amOnSubdomain()
|
219 |
+
*/
|
220 |
+
public function amOnSubdomain($subdomain) {
|
221 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args()));
|
222 |
+
}
|
223 |
+
|
224 |
+
|
225 |
+
/**
|
226 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
227 |
+
*
|
228 |
+
* Takes a screenshot of the current window and saves it to `tests/_output/debug`.
|
229 |
+
*
|
230 |
+
* ``` php
|
231 |
+
* <?php
|
232 |
+
* $I->amOnPage('/user/edit');
|
233 |
+
* $I->makeScreenshot('edit_page');
|
234 |
+
* // saved to: tests/_output/debug/edit_page.png
|
235 |
+
* $I->makeScreenshot();
|
236 |
+
* // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.png
|
237 |
+
* ```
|
238 |
+
*
|
239 |
+
* @param $name
|
240 |
+
* @see \Codeception\Module\WebDriver::makeScreenshot()
|
241 |
+
*/
|
242 |
+
public function makeScreenshot($name = null) {
|
243 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('makeScreenshot', func_get_args()));
|
244 |
+
}
|
245 |
+
|
246 |
+
|
247 |
+
/**
|
248 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
249 |
+
*
|
250 |
+
* Saves current page's HTML into a temprary file.
|
251 |
+
* Use this method in debug mode within an interactive pause to get a source code of current page.
|
252 |
+
*
|
253 |
+
* ```php
|
254 |
+
* <?php
|
255 |
+
* $I->makeHtmlSnapshot('edit_page');
|
256 |
+
* // saved to: tests/_output/debug/edit_page.html
|
257 |
+
* $I->makeHtmlSnapshot();
|
258 |
+
* // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.html
|
259 |
+
* ```
|
260 |
+
*
|
261 |
+
* @param null $name
|
262 |
+
* @see \Codeception\Module\WebDriver::makeHtmlSnapshot()
|
263 |
+
*/
|
264 |
+
public function makeHtmlSnapshot($name = null) {
|
265 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('makeHtmlSnapshot', func_get_args()));
|
266 |
+
}
|
267 |
+
|
268 |
+
|
269 |
+
/**
|
270 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
271 |
+
*
|
272 |
+
* Resize the current window.
|
273 |
+
*
|
274 |
+
* ``` php
|
275 |
+
* <?php
|
276 |
+
* $I->resizeWindow(800, 600);
|
277 |
+
*
|
278 |
+
* ```
|
279 |
+
*
|
280 |
+
* @param int $width
|
281 |
+
* @param int $height
|
282 |
+
* @see \Codeception\Module\WebDriver::resizeWindow()
|
283 |
+
*/
|
284 |
+
public function resizeWindow($width, $height) {
|
285 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('resizeWindow', func_get_args()));
|
286 |
+
}
|
287 |
+
|
288 |
+
|
289 |
+
/**
|
290 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
291 |
+
*
|
292 |
+
* Checks that a cookie with the given name is set.
|
293 |
+
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
294 |
+
*
|
295 |
+
* ``` php
|
296 |
+
* <?php
|
297 |
+
* $I->seeCookie('PHPSESSID');
|
298 |
+
* ?>
|
299 |
+
* ```
|
300 |
+
*
|
301 |
+
* @param $cookie
|
302 |
+
* @param array $params
|
303 |
+
* @return mixed
|
304 |
+
* @see \Codeception\Module\WebDriver::seeCookie()
|
305 |
+
*/
|
306 |
+
public function seeCookie($cookie, $params = null) {
|
307 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
|
308 |
+
}
|
309 |
+
/**
|
310 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
311 |
+
*
|
312 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
313 |
+
* Checks that a cookie with the given name is set.
|
314 |
+
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
315 |
+
*
|
316 |
+
* ``` php
|
317 |
+
* <?php
|
318 |
+
* $I->seeCookie('PHPSESSID');
|
319 |
+
* ?>
|
320 |
+
* ```
|
321 |
+
*
|
322 |
+
* @param $cookie
|
323 |
+
* @param array $params
|
324 |
+
* @return mixed
|
325 |
+
* @see \Codeception\Module\WebDriver::seeCookie()
|
326 |
+
*/
|
327 |
+
public function canSeeCookie($cookie, $params = null) {
|
328 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
|
329 |
+
}
|
330 |
+
|
331 |
+
|
332 |
+
/**
|
333 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
334 |
+
*
|
335 |
+
* Checks that there isn't a cookie with the given name.
|
336 |
+
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
337 |
+
*
|
338 |
+
* @param $cookie
|
339 |
+
*
|
340 |
+
* @param array $params
|
341 |
+
* @return mixed
|
342 |
+
* @see \Codeception\Module\WebDriver::dontSeeCookie()
|
343 |
+
*/
|
344 |
+
public function dontSeeCookie($cookie, $params = null) {
|
345 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCookie', func_get_args()));
|
346 |
+
}
|
347 |
+
/**
|
348 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
349 |
+
*
|
350 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
351 |
+
* Checks that there isn't a cookie with the given name.
|
352 |
+
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
353 |
+
*
|
354 |
+
* @param $cookie
|
355 |
+
*
|
356 |
+
* @param array $params
|
357 |
+
* @return mixed
|
358 |
+
* @see \Codeception\Module\WebDriver::dontSeeCookie()
|
359 |
+
*/
|
360 |
+
public function cantSeeCookie($cookie, $params = null) {
|
361 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
|
362 |
+
}
|
363 |
+
|
364 |
+
|
365 |
+
/**
|
366 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
367 |
+
*
|
368 |
+
* Sets a cookie with the given name and value.
|
369 |
+
* You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument.
|
370 |
+
*
|
371 |
+
* ``` php
|
372 |
+
* <?php
|
373 |
+
* $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3');
|
374 |
+
* ?>
|
375 |
+
* ```
|
376 |
+
*
|
377 |
+
* @param $name
|
378 |
+
* @param $val
|
379 |
+
* @param array $params
|
380 |
+
*
|
381 |
+
* @return mixed
|
382 |
+
* @see \Codeception\Module\WebDriver::setCookie()
|
383 |
+
*/
|
384 |
+
public function setCookie($cookie, $value, $params = null, $showDebug = null) {
|
385 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
|
386 |
+
}
|
387 |
+
|
388 |
+
|
389 |
+
/**
|
390 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
391 |
+
*
|
392 |
+
* Unsets cookie with the given name.
|
393 |
+
* You can set additional cookie params like `domain`, `path` in array passed as last argument.
|
394 |
+
*
|
395 |
+
* @param $cookie
|
396 |
+
*
|
397 |
+
* @param array $params
|
398 |
+
* @return mixed
|
399 |
+
* @see \Codeception\Module\WebDriver::resetCookie()
|
400 |
+
*/
|
401 |
+
public function resetCookie($cookie, $params = null) {
|
402 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
|
403 |
+
}
|
404 |
+
|
405 |
+
|
406 |
+
/**
|
407 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
408 |
+
*
|
409 |
+
* Grabs a cookie value.
|
410 |
+
* You can set additional cookie params like `domain`, `path` in array passed as last argument.
|
411 |
+
*
|
412 |
+
* @param $cookie
|
413 |
+
*
|
414 |
+
* @param array $params
|
415 |
+
* @return mixed
|
416 |
+
* @see \Codeception\Module\WebDriver::grabCookie()
|
417 |
+
*/
|
418 |
+
public function grabCookie($cookie, $params = null) {
|
419 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
|
420 |
+
}
|
421 |
+
|
422 |
+
|
423 |
+
/**
|
424 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
425 |
+
*
|
426 |
+
* Grabs current page source code.
|
427 |
+
*
|
428 |
+
* @throws ModuleException if no page was opened.
|
429 |
+
*
|
430 |
+
* @return string Current page source code.
|
431 |
+
* @see \Codeception\Module\WebDriver::grabPageSource()
|
432 |
+
*/
|
433 |
+
public function grabPageSource() {
|
434 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabPageSource', func_get_args()));
|
435 |
+
}
|
436 |
+
|
437 |
+
|
438 |
+
/**
|
439 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
440 |
+
*
|
441 |
+
* Open web page at the given absolute URL and sets its hostname as the base host.
|
442 |
+
*
|
443 |
+
* ``` php
|
444 |
+
* <?php
|
445 |
+
* $I->amOnUrl('http://codeception.com');
|
446 |
+
* $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart
|
447 |
+
* ?>
|
448 |
+
* ```
|
449 |
+
* @see \Codeception\Module\WebDriver::amOnUrl()
|
450 |
+
*/
|
451 |
+
public function amOnUrl($url) {
|
452 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args()));
|
453 |
+
}
|
454 |
+
|
455 |
+
|
456 |
+
/**
|
457 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
458 |
+
*
|
459 |
+
* Opens the page for the given relative URI.
|
460 |
+
*
|
461 |
+
* ``` php
|
462 |
+
* <?php
|
463 |
+
* // opens front page
|
464 |
+
* $I->amOnPage('/');
|
465 |
+
* // opens /register page
|
466 |
+
* $I->amOnPage('/register');
|
467 |
+
* ```
|
468 |
+
*
|
469 |
+
* @param string $page
|
470 |
+
* @see \Codeception\Module\WebDriver::amOnPage()
|
471 |
+
*/
|
472 |
+
public function amOnPage($page) {
|
473 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args()));
|
474 |
+
}
|
475 |
+
|
476 |
+
|
477 |
+
/**
|
478 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
479 |
+
*
|
480 |
+
* Checks that the current page contains the given string (case insensitive).
|
481 |
+
*
|
482 |
+
* You can specify a specific HTML element (via CSS or XPath) as the second
|
483 |
+
* parameter to only search within that element.
|
484 |
+
*
|
485 |
+
* ``` php
|
486 |
+
* <?php
|
487 |
+
* $I->see('Logout'); // I can suppose user is logged in
|
488 |
+
* $I->see('Sign Up', 'h1'); // I can suppose it's a signup page
|
489 |
+
* $I->see('Sign Up', '//body/h1'); // with XPath
|
490 |
+
* $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator
|
491 |
+
* ```
|
492 |
+
*
|
493 |
+
* Note that the search is done after stripping all HTML tags from the body,
|
494 |
+
* so `$I->see('strong')` will return true for strings like:
|
495 |
+
*
|
496 |
+
* - `<p>I am Stronger than thou</p>`
|
497 |
+
* - `<script>document.createElement('strong');</script>`
|
498 |
+
*
|
499 |
+
* But will *not* be true for strings like:
|
500 |
+
*
|
501 |
+
* - `<strong>Home</strong>`
|
502 |
+
* - `<div class="strong">Home</strong>`
|
503 |
+
* - `<!-- strong -->`
|
504 |
+
*
|
505 |
+
* For checking the raw source code, use `seeInSource()`.
|
506 |
+
*
|
507 |
+
* @param string $text
|
508 |
+
* @param array|string $selector optional
|
509 |
+
* @see \Codeception\Module\WebDriver::see()
|
510 |
+
*/
|
511 |
+
public function see($text, $selector = null) {
|
512 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
|
513 |
+
}
|
514 |
+
/**
|
515 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
516 |
+
*
|
517 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
518 |
+
* Checks that the current page contains the given string (case insensitive).
|
519 |
+
*
|
520 |
+
* You can specify a specific HTML element (via CSS or XPath) as the second
|
521 |
+
* parameter to only search within that element.
|
522 |
+
*
|
523 |
+
* ``` php
|
524 |
+
* <?php
|
525 |
+
* $I->see('Logout'); // I can suppose user is logged in
|
526 |
+
* $I->see('Sign Up', 'h1'); // I can suppose it's a signup page
|
527 |
+
* $I->see('Sign Up', '//body/h1'); // with XPath
|
528 |
+
* $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator
|
529 |
+
* ```
|
530 |
+
*
|
531 |
+
* Note that the search is done after stripping all HTML tags from the body,
|
532 |
+
* so `$I->see('strong')` will return true for strings like:
|
533 |
+
*
|
534 |
+
* - `<p>I am Stronger than thou</p>`
|
535 |
+
* - `<script>document.createElement('strong');</script>`
|
536 |
+
*
|
537 |
+
* But will *not* be true for strings like:
|
538 |
+
*
|
539 |
+
* - `<strong>Home</strong>`
|
540 |
+
* - `<div class="strong">Home</strong>`
|
541 |
+
* - `<!-- strong -->`
|
542 |
+
*
|
543 |
+
* For checking the raw source code, use `seeInSource()`.
|
544 |
+
*
|
545 |
+
* @param string $text
|
546 |
+
* @param array|string $selector optional
|
547 |
+
* @see \Codeception\Module\WebDriver::see()
|
548 |
+
*/
|
549 |
+
public function canSee($text, $selector = null) {
|
550 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
|
551 |
+
}
|
552 |
+
|
553 |
+
|
554 |
+
/**
|
555 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
556 |
+
*
|
557 |
+
* Checks that the current page doesn't contain the text specified (case insensitive).
|
558 |
+
* Give a locator as the second parameter to match a specific region.
|
559 |
+
*
|
560 |
+
* ```php
|
561 |
+
* <?php
|
562 |
+
* $I->dontSee('Login'); // I can suppose user is already logged in
|
563 |
+
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
|
564 |
+
* $I->dontSee('Sign Up','//body/h1'); // with XPath
|
565 |
+
* $I->dontSee('Sign Up', ['css' => 'body h1']); // with strict CSS locator
|
566 |
+
* ```
|
567 |
+
*
|
568 |
+
* Note that the search is done after stripping all HTML tags from the body,
|
569 |
+
* so `$I->dontSee('strong')` will fail on strings like:
|
570 |
+
*
|
571 |
+
* - `<p>I am Stronger than thou</p>`
|
572 |
+
* - `<script>document.createElement('strong');</script>`
|
573 |
+
*
|
574 |
+
* But will ignore strings like:
|
575 |
+
*
|
576 |
+
* - `<strong>Home</strong>`
|
577 |
+
* - `<div class="strong">Home</strong>`
|
578 |
+
* - `<!-- strong -->`
|
579 |
+
*
|
580 |
+
* For checking the raw source code, use `seeInSource()`.
|
581 |
+
*
|
582 |
+
* @param string $text
|
583 |
+
* @param array|string $selector optional
|
584 |
+
* @see \Codeception\Module\WebDriver::dontSee()
|
585 |
+
*/
|
586 |
+
public function dontSee($text, $selector = null) {
|
587 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSee', func_get_args()));
|
588 |
+
}
|
589 |
+
/**
|
590 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
591 |
+
*
|
592 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
593 |
+
* Checks that the current page doesn't contain the text specified (case insensitive).
|
594 |
+
* Give a locator as the second parameter to match a specific region.
|
595 |
+
*
|
596 |
+
* ```php
|
597 |
+
* <?php
|
598 |
+
* $I->dontSee('Login'); // I can suppose user is already logged in
|
599 |
+
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
|
600 |
+
* $I->dontSee('Sign Up','//body/h1'); // with XPath
|
601 |
+
* $I->dontSee('Sign Up', ['css' => 'body h1']); // with strict CSS locator
|
602 |
+
* ```
|
603 |
+
*
|
604 |
+
* Note that the search is done after stripping all HTML tags from the body,
|
605 |
+
* so `$I->dontSee('strong')` will fail on strings like:
|
606 |
+
*
|
607 |
+
* - `<p>I am Stronger than thou</p>`
|
608 |
+
* - `<script>document.createElement('strong');</script>`
|
609 |
+
*
|
610 |
+
* But will ignore strings like:
|
611 |
+
*
|
612 |
+
* - `<strong>Home</strong>`
|
613 |
+
* - `<div class="strong">Home</strong>`
|
614 |
+
* - `<!-- strong -->`
|
615 |
+
*
|
616 |
+
* For checking the raw source code, use `seeInSource()`.
|
617 |
+
*
|
618 |
+
* @param string $text
|
619 |
+
* @param array|string $selector optional
|
620 |
+
* @see \Codeception\Module\WebDriver::dontSee()
|
621 |
+
*/
|
622 |
+
public function cantSee($text, $selector = null) {
|
623 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
|
624 |
+
}
|
625 |
+
|
626 |
+
|
627 |
+
/**
|
628 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
629 |
+
*
|
630 |
+
* Checks that the current page contains the given string in its
|
631 |
+
* raw source code.
|
632 |
+
*
|
633 |
+
* ``` php
|
634 |
+
* <?php
|
635 |
+
* $I->seeInSource('<h1>Green eggs & ham</h1>');
|
636 |
+
* ```
|
637 |
+
*
|
638 |
+
* @param $raw
|
639 |
+
* @see \Codeception\Module\WebDriver::seeInSource()
|
640 |
+
*/
|
641 |
+
public function seeInSource($raw) {
|
642 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args()));
|
643 |
+
}
|
644 |
+
/**
|
645 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
646 |
+
*
|
647 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
648 |
+
* Checks that the current page contains the given string in its
|
649 |
+
* raw source code.
|
650 |
+
*
|
651 |
+
* ``` php
|
652 |
+
* <?php
|
653 |
+
* $I->seeInSource('<h1>Green eggs & ham</h1>');
|
654 |
+
* ```
|
655 |
+
*
|
656 |
+
* @param $raw
|
657 |
+
* @see \Codeception\Module\WebDriver::seeInSource()
|
658 |
+
*/
|
659 |
+
public function canSeeInSource($raw) {
|
660 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args()));
|
661 |
+
}
|
662 |
+
|
663 |
+
|
664 |
+
/**
|
665 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
666 |
+
*
|
667 |
+
* Checks that the current page contains the given string in its
|
668 |
+
* raw source code.
|
669 |
+
*
|
670 |
+
* ```php
|
671 |
+
* <?php
|
672 |
+
* $I->dontSeeInSource('<h1>Green eggs & ham</h1>');
|
673 |
+
* ```
|
674 |
+
*
|
675 |
+
* @param $raw
|
676 |
+
* @see \Codeception\Module\WebDriver::dontSeeInSource()
|
677 |
+
*/
|
678 |
+
public function dontSeeInSource($raw) {
|
679 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInSource', func_get_args()));
|
680 |
+
}
|
681 |
+
/**
|
682 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
683 |
+
*
|
684 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
685 |
+
* Checks that the current page contains the given string in its
|
686 |
+
* raw source code.
|
687 |
+
*
|
688 |
+
* ```php
|
689 |
+
* <?php
|
690 |
+
* $I->dontSeeInSource('<h1>Green eggs & ham</h1>');
|
691 |
+
* ```
|
692 |
+
*
|
693 |
+
* @param $raw
|
694 |
+
* @see \Codeception\Module\WebDriver::dontSeeInSource()
|
695 |
+
*/
|
696 |
+
public function cantSeeInSource($raw) {
|
697 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args()));
|
698 |
+
}
|
699 |
+
|
700 |
+
|
701 |
+
/**
|
702 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
703 |
+
*
|
704 |
+
* Checks that the page source contains the given string.
|
705 |
+
*
|
706 |
+
* ```php
|
707 |
+
* <?php
|
708 |
+
* $I->seeInPageSource('<link rel="apple-touch-icon"');
|
709 |
+
* ```
|
710 |
+
*
|
711 |
+
* @param $text
|
712 |
+
* @see \Codeception\Module\WebDriver::seeInPageSource()
|
713 |
+
*/
|
714 |
+
public function seeInPageSource($text) {
|
715 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPageSource', func_get_args()));
|
716 |
+
}
|
717 |
+
/**
|
718 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
719 |
+
*
|
720 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
721 |
+
* Checks that the page source contains the given string.
|
722 |
+
*
|
723 |
+
* ```php
|
724 |
+
* <?php
|
725 |
+
* $I->seeInPageSource('<link rel="apple-touch-icon"');
|
726 |
+
* ```
|
727 |
+
*
|
728 |
+
* @param $text
|
729 |
+
* @see \Codeception\Module\WebDriver::seeInPageSource()
|
730 |
+
*/
|
731 |
+
public function canSeeInPageSource($text) {
|
732 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPageSource', func_get_args()));
|
733 |
+
}
|
734 |
+
|
735 |
+
|
736 |
+
/**
|
737 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
738 |
+
*
|
739 |
+
* Checks that the page source doesn't contain the given string.
|
740 |
+
*
|
741 |
+
* @param $text
|
742 |
+
* @see \Codeception\Module\WebDriver::dontSeeInPageSource()
|
743 |
+
*/
|
744 |
+
public function dontSeeInPageSource($text) {
|
745 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInPageSource', func_get_args()));
|
746 |
+
}
|
747 |
+
/**
|
748 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
749 |
+
*
|
750 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
751 |
+
* Checks that the page source doesn't contain the given string.
|
752 |
+
*
|
753 |
+
* @param $text
|
754 |
+
* @see \Codeception\Module\WebDriver::dontSeeInPageSource()
|
755 |
+
*/
|
756 |
+
public function cantSeeInPageSource($text) {
|
757 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPageSource', func_get_args()));
|
758 |
+
}
|
759 |
+
|
760 |
+
|
761 |
+
/**
|
762 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
763 |
+
*
|
764 |
+
* Perform a click on a link or a button, given by a locator.
|
765 |
+
* If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
|
766 |
+
* For buttons, the "value" attribute, "name" attribute, and inner text are searched.
|
767 |
+
* For links, the link text is searched.
|
768 |
+
* For images, the "alt" attribute and inner text of any parent links are searched.
|
769 |
+
*
|
770 |
+
* The second parameter is a context (CSS or XPath locator) to narrow the search.
|
771 |
+
*
|
772 |
+
* Note that if the locator matches a button of type `submit`, the form will be submitted.
|
773 |
+
*
|
774 |
+
* ``` php
|
775 |
+
* <?php
|
776 |
+
* // simple link
|
777 |
+
* $I->click('Logout');
|
778 |
+
* // button of form
|
779 |
+
* $I->click('Submit');
|
780 |
+
* // CSS button
|
781 |
+
* $I->click('#form input[type=submit]');
|
782 |
+
* // XPath
|
783 |
+
* $I->click('//form/*[@type="submit"]');
|
784 |
+
* // link in context
|
785 |
+
* $I->click('Logout', '#nav');
|
786 |
+
* // using strict locator
|
787 |
+
* $I->click(['link' => 'Login']);
|
788 |
+
* ?>
|
789 |
+
* ```
|
790 |
+
*
|
791 |
+
* @param $link
|
792 |
+
* @param $context
|
793 |
+
* @see \Codeception\Module\WebDriver::click()
|
794 |
+
*/
|
795 |
+
public function click($link, $context = null) {
|
796 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args()));
|
797 |
+
}
|
798 |
+
|
799 |
+
|
800 |
+
/**
|
801 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
802 |
+
*
|
803 |
+
* Checks that there's a link with the specified text.
|
804 |
+
* Give a full URL as the second parameter to match links with that exact URL.
|
805 |
+
*
|
806 |
+
* ``` php
|
807 |
+
* <?php
|
808 |
+
* $I->seeLink('Logout'); // matches <a href="#">Logout</a>
|
809 |
+
* $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
|
810 |
+
* ?>
|
811 |
+
* ```
|
812 |
+
*
|
813 |
+
* @param string $text
|
814 |
+
* @param string $url optional
|
815 |
+
* @see \Codeception\Module\WebDriver::seeLink()
|
816 |
+
*/
|
817 |
+
public function seeLink($text, $url = null) {
|
818 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
|
819 |
+
}
|
820 |
+
/**
|
821 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
822 |
+
*
|
823 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
824 |
+
* Checks that there's a link with the specified text.
|
825 |
+
* Give a full URL as the second parameter to match links with that exact URL.
|
826 |
+
*
|
827 |
+
* ``` php
|
828 |
+
* <?php
|
829 |
+
* $I->seeLink('Logout'); // matches <a href="#">Logout</a>
|
830 |
+
* $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
|
831 |
+
* ?>
|
832 |
+
* ```
|
833 |
+
*
|
834 |
+
* @param string $text
|
835 |
+
* @param string $url optional
|
836 |
+
* @see \Codeception\Module\WebDriver::seeLink()
|
837 |
+
*/
|
838 |
+
public function canSeeLink($text, $url = null) {
|
839 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
|
840 |
+
}
|
841 |
+
|
842 |
+
|
843 |
+
/**
|
844 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
845 |
+
*
|
846 |
+
* Checks that the page doesn't contain a link with the given string.
|
847 |
+
* If the second parameter is given, only links with a matching "href" attribute will be checked.
|
848 |
+
*
|
849 |
+
* ``` php
|
850 |
+
* <?php
|
851 |
+
* $I->dontSeeLink('Logout'); // I suppose user is not logged in
|
852 |
+
* $I->dontSeeLink('Checkout now', '/store/cart.php');
|
853 |
+
* ?>
|
854 |
+
* ```
|
855 |
+
*
|
856 |
+
* @param string $text
|
857 |
+
* @param string $url optional
|
858 |
+
* @see \Codeception\Module\WebDriver::dontSeeLink()
|
859 |
+
*/
|
860 |
+
public function dontSeeLink($text, $url = null) {
|
861 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeLink', func_get_args()));
|
862 |
+
}
|
863 |
+
/**
|
864 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
865 |
+
*
|
866 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
867 |
+
* Checks that the page doesn't contain a link with the given string.
|
868 |
+
* If the second parameter is given, only links with a matching "href" attribute will be checked.
|
869 |
+
*
|
870 |
+
* ``` php
|
871 |
+
* <?php
|
872 |
+
* $I->dontSeeLink('Logout'); // I suppose user is not logged in
|
873 |
+
* $I->dontSeeLink('Checkout now', '/store/cart.php');
|
874 |
+
* ?>
|
875 |
+
* ```
|
876 |
+
*
|
877 |
+
* @param string $text
|
878 |
+
* @param string $url optional
|
879 |
+
* @see \Codeception\Module\WebDriver::dontSeeLink()
|
880 |
+
*/
|
881 |
+
public function cantSeeLink($text, $url = null) {
|
882 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
|
883 |
+
}
|
884 |
+
|
885 |
+
|
886 |
+
/**
|
887 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
888 |
+
*
|
889 |
+
* Checks that current URI contains the given string.
|
890 |
+
*
|
891 |
+
* ``` php
|
892 |
+
* <?php
|
893 |
+
* // to match: /home/dashboard
|
894 |
+
* $I->seeInCurrentUrl('home');
|
895 |
+
* // to match: /users/1
|
896 |
+
* $I->seeInCurrentUrl('/users/');
|
897 |
+
* ?>
|
898 |
+
* ```
|
899 |
+
*
|
900 |
+
* @param string $uri
|
901 |
+
* @see \Codeception\Module\WebDriver::seeInCurrentUrl()
|
902 |
+
*/
|
903 |
+
public function seeInCurrentUrl($uri) {
|
904 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
|
905 |
+
}
|
906 |
+
/**
|
907 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
908 |
+
*
|
909 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
910 |
+
* Checks that current URI contains the given string.
|
911 |
+
*
|
912 |
+
* ``` php
|
913 |
+
* <?php
|
914 |
+
* // to match: /home/dashboard
|
915 |
+
* $I->seeInCurrentUrl('home');
|
916 |
+
* // to match: /users/1
|
917 |
+
* $I->seeInCurrentUrl('/users/');
|
918 |
+
* ?>
|
919 |
+
* ```
|
920 |
+
*
|
921 |
+
* @param string $uri
|
922 |
+
* @see \Codeception\Module\WebDriver::seeInCurrentUrl()
|
923 |
+
*/
|
924 |
+
public function canSeeInCurrentUrl($uri) {
|
925 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
|
926 |
+
}
|
927 |
+
|
928 |
+
|
929 |
+
/**
|
930 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
931 |
+
*
|
932 |
+
* Checks that the current URL is equal to the given string.
|
933 |
+
* Unlike `seeInCurrentUrl`, this only matches the full URL.
|
934 |
+
*
|
935 |
+
* ``` php
|
936 |
+
* <?php
|
937 |
+
* // to match root url
|
938 |
+
* $I->seeCurrentUrlEquals('/');
|
939 |
+
* ?>
|
940 |
+
* ```
|
941 |
+
*
|
942 |
+
* @param string $uri
|
943 |
+
* @see \Codeception\Module\WebDriver::seeCurrentUrlEquals()
|
944 |
+
*/
|
945 |
+
public function seeCurrentUrlEquals($uri) {
|
946 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
|
947 |
+
}
|
948 |
+
/**
|
949 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
950 |
+
*
|
951 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
952 |
+
* Checks that the current URL is equal to the given string.
|
953 |
+
* Unlike `seeInCurrentUrl`, this only matches the full URL.
|
954 |
+
*
|
955 |
+
* ``` php
|
956 |
+
* <?php
|
957 |
+
* // to match root url
|
958 |
+
* $I->seeCurrentUrlEquals('/');
|
959 |
+
* ?>
|
960 |
+
* ```
|
961 |
+
*
|
962 |
+
* @param string $uri
|
963 |
+
* @see \Codeception\Module\WebDriver::seeCurrentUrlEquals()
|
964 |
+
*/
|
965 |
+
public function canSeeCurrentUrlEquals($uri) {
|
966 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
|
967 |
+
}
|
968 |
+
|
969 |
+
|
970 |
+
/**
|
971 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
972 |
+
*
|
973 |
+
* Checks that the current URL matches the given regular expression.
|
974 |
+
*
|
975 |
+
* ``` php
|
976 |
+
* <?php
|
977 |
+
* // to match root url
|
978 |
+
* $I->seeCurrentUrlMatches('~^/users/(\d+)~');
|
979 |
+
* ?>
|
980 |
+
* ```
|
981 |
+
*
|
982 |
+
* @param string $uri
|
983 |
+
* @see \Codeception\Module\WebDriver::seeCurrentUrlMatches()
|
984 |
+
*/
|
985 |
+
public function seeCurrentUrlMatches($uri) {
|
986 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
|
987 |
+
}
|
988 |
+
/**
|
989 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
990 |
+
*
|
991 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
992 |
+
* Checks that the current URL matches the given regular expression.
|
993 |
+
*
|
994 |
+
* ``` php
|
995 |
+
* <?php
|
996 |
+
* // to match root url
|
997 |
+
* $I->seeCurrentUrlMatches('~^/users/(\d+)~');
|
998 |
+
* ?>
|
999 |
+
* ```
|
1000 |
+
*
|
1001 |
+
* @param string $uri
|
1002 |
+
* @see \Codeception\Module\WebDriver::seeCurrentUrlMatches()
|
1003 |
+
*/
|
1004 |
+
public function canSeeCurrentUrlMatches($uri) {
|
1005 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
|
1009 |
+
/**
|
1010 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1011 |
+
*
|
1012 |
+
* Checks that the current URI doesn't contain the given string.
|
1013 |
+
*
|
1014 |
+
* ``` php
|
1015 |
+
* <?php
|
1016 |
+
* $I->dontSeeInCurrentUrl('/users/');
|
1017 |
+
* ?>
|
1018 |
+
* ```
|
1019 |
+
*
|
1020 |
+
* @param string $uri
|
1021 |
+
* @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl()
|
1022 |
+
*/
|
1023 |
+
public function dontSeeInCurrentUrl($uri) {
|
1024 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInCurrentUrl', func_get_args()));
|
1025 |
+
}
|
1026 |
+
/**
|
1027 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1028 |
+
*
|
1029 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1030 |
+
* Checks that the current URI doesn't contain the given string.
|
1031 |
+
*
|
1032 |
+
* ``` php
|
1033 |
+
* <?php
|
1034 |
+
* $I->dontSeeInCurrentUrl('/users/');
|
1035 |
+
* ?>
|
1036 |
+
* ```
|
1037 |
+
*
|
1038 |
+
* @param string $uri
|
1039 |
+
* @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl()
|
1040 |
+
*/
|
1041 |
+
public function cantSeeInCurrentUrl($uri) {
|
1042 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
|
1046 |
+
/**
|
1047 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1048 |
+
*
|
1049 |
+
* Checks that the current URL doesn't equal the given string.
|
1050 |
+
* Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
|
1051 |
+
*
|
1052 |
+
* ``` php
|
1053 |
+
* <?php
|
1054 |
+
* // current url is not root
|
1055 |
+
* $I->dontSeeCurrentUrlEquals('/');
|
1056 |
+
* ?>
|
1057 |
+
* ```
|
1058 |
+
*
|
1059 |
+
* @param string $uri
|
1060 |
+
* @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals()
|
1061 |
+
*/
|
1062 |
+
public function dontSeeCurrentUrlEquals($uri) {
|
1063 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlEquals', func_get_args()));
|
1064 |
+
}
|
1065 |
+
/**
|
1066 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1067 |
+
*
|
1068 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1069 |
+
* Checks that the current URL doesn't equal the given string.
|
1070 |
+
* Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
|
1071 |
+
*
|
1072 |
+
* ``` php
|
1073 |
+
* <?php
|
1074 |
+
* // current url is not root
|
1075 |
+
* $I->dontSeeCurrentUrlEquals('/');
|
1076 |
+
* ?>
|
1077 |
+
* ```
|
1078 |
+
*
|
1079 |
+
* @param string $uri
|
1080 |
+
* @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals()
|
1081 |
+
*/
|
1082 |
+
public function cantSeeCurrentUrlEquals($uri) {
|
1083 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
|
1087 |
+
/**
|
1088 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1089 |
+
*
|
1090 |
+
* Checks that current url doesn't match the given regular expression.
|
1091 |
+
*
|
1092 |
+
* ``` php
|
1093 |
+
* <?php
|
1094 |
+
* // to match root url
|
1095 |
+
* $I->dontSeeCurrentUrlMatches('~^/users/(\d+)~');
|
1096 |
+
* ?>
|
1097 |
+
* ```
|
1098 |
+
*
|
1099 |
+
* @param string $uri
|
1100 |
+
* @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches()
|
1101 |
+
*/
|
1102 |
+
public function dontSeeCurrentUrlMatches($uri) {
|
1103 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlMatches', func_get_args()));
|
1104 |
+
}
|
1105 |
+
/**
|
1106 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1107 |
+
*
|
1108 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1109 |
+
* Checks that current url doesn't match the given regular expression.
|
1110 |
+
*
|
1111 |
+
* ``` php
|
1112 |
+
* <?php
|
1113 |
+
* // to match root url
|
1114 |
+
* $I->dontSeeCurrentUrlMatches('~^/users/(\d+)~');
|
1115 |
+
* ?>
|
1116 |
+
* ```
|
1117 |
+
*
|
1118 |
+
* @param string $uri
|
1119 |
+
* @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches()
|
1120 |
+
*/
|
1121 |
+
public function cantSeeCurrentUrlMatches($uri) {
|
1122 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
|
1126 |
+
/**
|
1127 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1128 |
+
*
|
1129 |
+
* Executes the given regular expression against the current URI and returns the first capturing group.
|
1130 |
+
* If no parameters are provided, the full URI is returned.
|
1131 |
+
*
|
1132 |
+
* ``` php
|
1133 |
+
* <?php
|
1134 |
+
* $user_id = $I->grabFromCurrentUrl('~^/user/(\d+)/~');
|
1135 |
+
* $uri = $I->grabFromCurrentUrl();
|
1136 |
+
* ?>
|
1137 |
+
* ```
|
1138 |
+
*
|
1139 |
+
* @param string $uri optional
|
1140 |
+
*
|
1141 |
+
* @return mixed
|
1142 |
+
* @see \Codeception\Module\WebDriver::grabFromCurrentUrl()
|
1143 |
+
*/
|
1144 |
+
public function grabFromCurrentUrl($uri = null) {
|
1145 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
|
1146 |
+
}
|
1147 |
+
|
1148 |
+
|
1149 |
+
/**
|
1150 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1151 |
+
*
|
1152 |
+
* Checks that the specified checkbox is checked.
|
1153 |
+
*
|
1154 |
+
* ``` php
|
1155 |
+
* <?php
|
1156 |
+
* $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
|
1157 |
+
* $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
|
1158 |
+
* $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
|
1159 |
+
* ?>
|
1160 |
+
* ```
|
1161 |
+
*
|
1162 |
+
* @param $checkbox
|
1163 |
+
* @see \Codeception\Module\WebDriver::seeCheckboxIsChecked()
|
1164 |
+
*/
|
1165 |
+
public function seeCheckboxIsChecked($checkbox) {
|
1166 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
|
1167 |
+
}
|
1168 |
+
/**
|
1169 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1170 |
+
*
|
1171 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1172 |
+
* Checks that the specified checkbox is checked.
|
1173 |
+
*
|
1174 |
+
* ``` php
|
1175 |
+
* <?php
|
1176 |
+
* $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
|
1177 |
+
* $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
|
1178 |
+
* $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
|
1179 |
+
* ?>
|
1180 |
+
* ```
|
1181 |
+
*
|
1182 |
+
* @param $checkbox
|
1183 |
+
* @see \Codeception\Module\WebDriver::seeCheckboxIsChecked()
|
1184 |
+
*/
|
1185 |
+
public function canSeeCheckboxIsChecked($checkbox) {
|
1186 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
|
1190 |
+
/**
|
1191 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1192 |
+
*
|
1193 |
+
* Check that the specified checkbox is unchecked.
|
1194 |
+
*
|
1195 |
+
* ``` php
|
1196 |
+
* <?php
|
1197 |
+
* $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
|
1198 |
+
* $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
|
1199 |
+
* ?>
|
1200 |
+
* ```
|
1201 |
+
*
|
1202 |
+
* @param $checkbox
|
1203 |
+
* @see \Codeception\Module\WebDriver::dontSeeCheckboxIsChecked()
|
1204 |
+
*/
|
1205 |
+
public function dontSeeCheckboxIsChecked($checkbox) {
|
1206 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCheckboxIsChecked', func_get_args()));
|
1207 |
+
}
|
1208 |
+
/**
|
1209 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1210 |
+
*
|
1211 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1212 |
+
* Check that the specified checkbox is unchecked.
|
1213 |
+
*
|
1214 |
+
* ``` php
|
1215 |
+
* <?php
|
1216 |
+
* $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
|
1217 |
+
* $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
|
1218 |
+
* ?>
|
1219 |
+
* ```
|
1220 |
+
*
|
1221 |
+
* @param $checkbox
|
1222 |
+
* @see \Codeception\Module\WebDriver::dontSeeCheckboxIsChecked()
|
1223 |
+
*/
|
1224 |
+
public function cantSeeCheckboxIsChecked($checkbox) {
|
1225 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
|
1226 |
+
}
|
1227 |
+
|
1228 |
+
|
1229 |
+
/**
|
1230 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1231 |
+
*
|
1232 |
+
* Checks that the given input field or textarea *equals* (i.e. not just contains) the given value.
|
1233 |
+
* Fields are matched by label text, the "name" attribute, CSS, or XPath.
|
1234 |
+
*
|
1235 |
+
* ``` php
|
1236 |
+
* <?php
|
1237 |
+
* $I->seeInField('Body','Type your comment here');
|
1238 |
+
* $I->seeInField('form textarea[name=body]','Type your comment here');
|
1239 |
+
* $I->seeInField('form input[type=hidden]','hidden_value');
|
1240 |
+
* $I->seeInField('#searchform input','Search');
|
1241 |
+
* $I->seeInField('//form/*[@name=search]','Search');
|
1242 |
+
* $I->seeInField(['name' => 'search'], 'Search');
|
1243 |
+
* ?>
|
1244 |
+
* ```
|
1245 |
+
*
|
1246 |
+
* @param $field
|
1247 |
+
* @param $value
|
1248 |
+
* @see \Codeception\Module\WebDriver::seeInField()
|
1249 |
+
*/
|
1250 |
+
public function seeInField($field, $value) {
|
1251 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
|
1252 |
+
}
|
1253 |
+
/**
|
1254 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1255 |
+
*
|
1256 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1257 |
+
* Checks that the given input field or textarea *equals* (i.e. not just contains) the given value.
|
1258 |
+
* Fields are matched by label text, the "name" attribute, CSS, or XPath.
|
1259 |
+
*
|
1260 |
+
* ``` php
|
1261 |
+
* <?php
|
1262 |
+
* $I->seeInField('Body','Type your comment here');
|
1263 |
+
* $I->seeInField('form textarea[name=body]','Type your comment here');
|
1264 |
+
* $I->seeInField('form input[type=hidden]','hidden_value');
|
1265 |
+
* $I->seeInField('#searchform input','Search');
|
1266 |
+
* $I->seeInField('//form/*[@name=search]','Search');
|
1267 |
+
* $I->seeInField(['name' => 'search'], 'Search');
|
1268 |
+
* ?>
|
1269 |
+
* ```
|
1270 |
+
*
|
1271 |
+
* @param $field
|
1272 |
+
* @param $value
|
1273 |
+
* @see \Codeception\Module\WebDriver::seeInField()
|
1274 |
+
*/
|
1275 |
+
public function canSeeInField($field, $value) {
|
1276 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
|
1277 |
+
}
|
1278 |
+
|
1279 |
+
|
1280 |
+
/**
|
1281 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1282 |
+
*
|
1283 |
+
* Checks that an input field or textarea doesn't contain the given value.
|
1284 |
+
* For fuzzy locators, the field is matched by label text, CSS and XPath.
|
1285 |
+
*
|
1286 |
+
* ``` php
|
1287 |
+
* <?php
|
1288 |
+
* $I->dontSeeInField('Body','Type your comment here');
|
1289 |
+
* $I->dontSeeInField('form textarea[name=body]','Type your comment here');
|
1290 |
+
* $I->dontSeeInField('form input[type=hidden]','hidden_value');
|
1291 |
+
* $I->dontSeeInField('#searchform input','Search');
|
1292 |
+
* $I->dontSeeInField('//form/*[@name=search]','Search');
|
1293 |
+
* $I->dontSeeInField(['name' => 'search'], 'Search');
|
1294 |
+
* ?>
|
1295 |
+
* ```
|
1296 |
+
*
|
1297 |
+
* @param $field
|
1298 |
+
* @param $value
|
1299 |
+
* @see \Codeception\Module\WebDriver::dontSeeInField()
|
1300 |
+
*/
|
1301 |
+
public function dontSeeInField($field, $value) {
|
1302 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInField', func_get_args()));
|
1303 |
+
}
|
1304 |
+
/**
|
1305 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1306 |
+
*
|
1307 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1308 |
+
* Checks that an input field or textarea doesn't contain the given value.
|
1309 |
+
* For fuzzy locators, the field is matched by label text, CSS and XPath.
|
1310 |
+
*
|
1311 |
+
* ``` php
|
1312 |
+
* <?php
|
1313 |
+
* $I->dontSeeInField('Body','Type your comment here');
|
1314 |
+
* $I->dontSeeInField('form textarea[name=body]','Type your comment here');
|
1315 |
+
* $I->dontSeeInField('form input[type=hidden]','hidden_value');
|
1316 |
+
* $I->dontSeeInField('#searchform input','Search');
|
1317 |
+
* $I->dontSeeInField('//form/*[@name=search]','Search');
|
1318 |
+
* $I->dontSeeInField(['name' => 'search'], 'Search');
|
1319 |
+
* ?>
|
1320 |
+
* ```
|
1321 |
+
*
|
1322 |
+
* @param $field
|
1323 |
+
* @param $value
|
1324 |
+
* @see \Codeception\Module\WebDriver::dontSeeInField()
|
1325 |
+
*/
|
1326 |
+
public function cantSeeInField($field, $value) {
|
1327 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
|
1328 |
+
}
|
1329 |
+
|
1330 |
+
|
1331 |
+
/**
|
1332 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1333 |
+
*
|
1334 |
+
* Checks if the array of form parameters (name => value) are set on the form matched with the
|
1335 |
+
* passed selector.
|
1336 |
+
*
|
1337 |
+
* ``` php
|
1338 |
+
* <?php
|
1339 |
+
* $I->seeInFormFields('form[name=myform]', [
|
1340 |
+
* 'input1' => 'value',
|
1341 |
+
* 'input2' => 'other value',
|
1342 |
+
* ]);
|
1343 |
+
* ?>
|
1344 |
+
* ```
|
1345 |
+
*
|
1346 |
+
* For multi-select elements, or to check values of multiple elements with the same name, an
|
1347 |
+
* array may be passed:
|
1348 |
+
*
|
1349 |
+
* ``` php
|
1350 |
+
* <?php
|
1351 |
+
* $I->seeInFormFields('.form-class', [
|
1352 |
+
* 'multiselect' => [
|
1353 |
+
* 'value1',
|
1354 |
+
* 'value2',
|
1355 |
+
* ],
|
1356 |
+
* 'checkbox[]' => [
|
1357 |
+
* 'a checked value',
|
1358 |
+
* 'another checked value',
|
1359 |
+
* ],
|
1360 |
+
* ]);
|
1361 |
+
* ?>
|
1362 |
+
* ```
|
1363 |
+
*
|
1364 |
+
* Additionally, checkbox values can be checked with a boolean.
|
1365 |
+
*
|
1366 |
+
* ``` php
|
1367 |
+
* <?php
|
1368 |
+
* $I->seeInFormFields('#form-id', [
|
1369 |
+
* 'checkbox1' => true, // passes if checked
|
1370 |
+
* 'checkbox2' => false, // passes if unchecked
|
1371 |
+
* ]);
|
1372 |
+
* ?>
|
1373 |
+
* ```
|
1374 |
+
*
|
1375 |
+
* Pair this with submitForm for quick testing magic.
|
1376 |
+
*
|
1377 |
+
* ``` php
|
1378 |
+
* <?php
|
1379 |
+
* $form = [
|
1380 |
+
* 'field1' => 'value',
|
1381 |
+
* 'field2' => 'another value',
|
1382 |
+
* 'checkbox1' => true,
|
1383 |
+
* // ...
|
1384 |
+
* ];
|
1385 |
+
* $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
|
1386 |
+
* // $I->amOnPage('/path/to/form-page') may be needed
|
1387 |
+
* $I->seeInFormFields('//form[@id=my-form]', $form);
|
1388 |
+
* ?>
|
1389 |
+
* ```
|
1390 |
+
*
|
1391 |
+
* @param $formSelector
|
1392 |
+
* @param $params
|
1393 |
+
* @see \Codeception\Module\WebDriver::seeInFormFields()
|
1394 |
+
*/
|
1395 |
+
public function seeInFormFields($formSelector, $params) {
|
1396 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args()));
|
1397 |
+
}
|
1398 |
+
/**
|
1399 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1400 |
+
*
|
1401 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1402 |
+
* Checks if the array of form parameters (name => value) are set on the form matched with the
|
1403 |
+
* passed selector.
|
1404 |
+
*
|
1405 |
+
* ``` php
|
1406 |
+
* <?php
|
1407 |
+
* $I->seeInFormFields('form[name=myform]', [
|
1408 |
+
* 'input1' => 'value',
|
1409 |
+
* 'input2' => 'other value',
|
1410 |
+
* ]);
|
1411 |
+
* ?>
|
1412 |
+
* ```
|
1413 |
+
*
|
1414 |
+
* For multi-select elements, or to check values of multiple elements with the same name, an
|
1415 |
+
* array may be passed:
|
1416 |
+
*
|
1417 |
+
* ``` php
|
1418 |
+
* <?php
|
1419 |
+
* $I->seeInFormFields('.form-class', [
|
1420 |
+
* 'multiselect' => [
|
1421 |
+
* 'value1',
|
1422 |
+
* 'value2',
|
1423 |
+
* ],
|
1424 |
+
* 'checkbox[]' => [
|
1425 |
+
* 'a checked value',
|
1426 |
+
* 'another checked value',
|
1427 |
+
* ],
|
1428 |
+
* ]);
|
1429 |
+
* ?>
|
1430 |
+
* ```
|
1431 |
+
*
|
1432 |
+
* Additionally, checkbox values can be checked with a boolean.
|
1433 |
+
*
|
1434 |
+
* ``` php
|
1435 |
+
* <?php
|
1436 |
+
* $I->seeInFormFields('#form-id', [
|
1437 |
+
* 'checkbox1' => true, // passes if checked
|
1438 |
+
* 'checkbox2' => false, // passes if unchecked
|
1439 |
+
* ]);
|
1440 |
+
* ?>
|
1441 |
+
* ```
|
1442 |
+
*
|
1443 |
+
* Pair this with submitForm for quick testing magic.
|
1444 |
+
*
|
1445 |
+
* ``` php
|
1446 |
+
* <?php
|
1447 |
+
* $form = [
|
1448 |
+
* 'field1' => 'value',
|
1449 |
+
* 'field2' => 'another value',
|
1450 |
+
* 'checkbox1' => true,
|
1451 |
+
* // ...
|
1452 |
+
* ];
|
1453 |
+
* $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
|
1454 |
+
* // $I->amOnPage('/path/to/form-page') may be needed
|
1455 |
+
* $I->seeInFormFields('//form[@id=my-form]', $form);
|
1456 |
+
* ?>
|
1457 |
+
* ```
|
1458 |
+
*
|
1459 |
+
* @param $formSelector
|
1460 |
+
* @param $params
|
1461 |
+
* @see \Codeception\Module\WebDriver::seeInFormFields()
|
1462 |
+
*/
|
1463 |
+
public function canSeeInFormFields($formSelector, $params) {
|
1464 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args()));
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
|
1468 |
+
/**
|
1469 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1470 |
+
*
|
1471 |
+
* Checks if the array of form parameters (name => value) are not set on the form matched with
|
1472 |
+
* the passed selector.
|
1473 |
+
*
|
1474 |
+
* ``` php
|
1475 |
+
* <?php
|
1476 |
+
* $I->dontSeeInFormFields('form[name=myform]', [
|
1477 |
+
* 'input1' => 'non-existent value',
|
1478 |
+
* 'input2' => 'other non-existent value',
|
1479 |
+
* ]);
|
1480 |
+
* ?>
|
1481 |
+
* ```
|
1482 |
+
*
|
1483 |
+
* To check that an element hasn't been assigned any one of many values, an array can be passed
|
1484 |
+
* as the value:
|
1485 |
+
*
|
1486 |
+
* ``` php
|
1487 |
+
* <?php
|
1488 |
+
* $I->dontSeeInFormFields('.form-class', [
|
1489 |
+
* 'fieldName' => [
|
1490 |
+
* 'This value shouldn\'t be set',
|
1491 |
+
* 'And this value shouldn\'t be set',
|
1492 |
+
* ],
|
1493 |
+
* ]);
|
1494 |
+
* ?>
|
1495 |
+
* ```
|
1496 |
+
*
|
1497 |
+
* Additionally, checkbox values can be checked with a boolean.
|
1498 |
+
*
|
1499 |
+
* ``` php
|
1500 |
+
* <?php
|
1501 |
+
* $I->dontSeeInFormFields('#form-id', [
|
1502 |
+
* 'checkbox1' => true, // fails if checked
|
1503 |
+
* 'checkbox2' => false, // fails if unchecked
|
1504 |
+
* ]);
|
1505 |
+
* ?>
|
1506 |
+
* ```
|
1507 |
+
*
|
1508 |
+
* @param $formSelector
|
1509 |
+
* @param $params
|
1510 |
+
* @see \Codeception\Module\WebDriver::dontSeeInFormFields()
|
1511 |
+
*/
|
1512 |
+
public function dontSeeInFormFields($formSelector, $params) {
|
1513 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInFormFields', func_get_args()));
|
1514 |
+
}
|
1515 |
+
/**
|
1516 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1517 |
+
*
|
1518 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1519 |
+
* Checks if the array of form parameters (name => value) are not set on the form matched with
|
1520 |
+
* the passed selector.
|
1521 |
+
*
|
1522 |
+
* ``` php
|
1523 |
+
* <?php
|
1524 |
+
* $I->dontSeeInFormFields('form[name=myform]', [
|
1525 |
+
* 'input1' => 'non-existent value',
|
1526 |
+
* 'input2' => 'other non-existent value',
|
1527 |
+
* ]);
|
1528 |
+
* ?>
|
1529 |
+
* ```
|
1530 |
+
*
|
1531 |
+
* To check that an element hasn't been assigned any one of many values, an array can be passed
|
1532 |
+
* as the value:
|
1533 |
+
*
|
1534 |
+
* ``` php
|
1535 |
+
* <?php
|
1536 |
+
* $I->dontSeeInFormFields('.form-class', [
|
1537 |
+
* 'fieldName' => [
|
1538 |
+
* 'This value shouldn\'t be set',
|
1539 |
+
* 'And this value shouldn\'t be set',
|
1540 |
+
* ],
|
1541 |
+
* ]);
|
1542 |
+
* ?>
|
1543 |
+
* ```
|
1544 |
+
*
|
1545 |
+
* Additionally, checkbox values can be checked with a boolean.
|
1546 |
+
*
|
1547 |
+
* ``` php
|
1548 |
+
* <?php
|
1549 |
+
* $I->dontSeeInFormFields('#form-id', [
|
1550 |
+
* 'checkbox1' => true, // fails if checked
|
1551 |
+
* 'checkbox2' => false, // fails if unchecked
|
1552 |
+
* ]);
|
1553 |
+
* ?>
|
1554 |
+
* ```
|
1555 |
+
*
|
1556 |
+
* @param $formSelector
|
1557 |
+
* @param $params
|
1558 |
+
* @see \Codeception\Module\WebDriver::dontSeeInFormFields()
|
1559 |
+
*/
|
1560 |
+
public function cantSeeInFormFields($formSelector, $params) {
|
1561 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args()));
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
|
1565 |
+
/**
|
1566 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1567 |
+
*
|
1568 |
+
* Selects an option in a select tag or in radio button group.
|
1569 |
+
*
|
1570 |
+
* ``` php
|
1571 |
+
* <?php
|
1572 |
+
* $I->selectOption('form select[name=account]', 'Premium');
|
1573 |
+
* $I->selectOption('form input[name=payment]', 'Monthly');
|
1574 |
+
* $I->selectOption('//form/select[@name=account]', 'Monthly');
|
1575 |
+
* ?>
|
1576 |
+
* ```
|
1577 |
+
*
|
1578 |
+
* Provide an array for the second argument to select multiple options:
|
1579 |
+
*
|
1580 |
+
* ``` php
|
1581 |
+
* <?php
|
1582 |
+
* $I->selectOption('Which OS do you use?', array('Windows','Linux'));
|
1583 |
+
* ?>
|
1584 |
+
* ```
|
1585 |
+
*
|
1586 |
+
* Or provide an associative array for the second argument to specifically define which selection method should be used:
|
1587 |
+
*
|
1588 |
+
* ``` php
|
1589 |
+
* <?php
|
1590 |
+
* $I->selectOption('Which OS do you use?', array('text' => 'Windows')); // Only search by text 'Windows'
|
1591 |
+
* $I->selectOption('Which OS do you use?', array('value' => 'windows')); // Only search by value 'windows'
|
1592 |
+
* ?>
|
1593 |
+
* ```
|
1594 |
+
*
|
1595 |
+
* @param $select
|
1596 |
+
* @param $option
|
1597 |
+
* @see \Codeception\Module\WebDriver::selectOption()
|
1598 |
+
*/
|
1599 |
+
public function selectOption($select, $option) {
|
1600 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args()));
|
1601 |
+
}
|
1602 |
+
|
1603 |
+
|
1604 |
+
/**
|
1605 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1606 |
+
*
|
1607 |
+
* Unselect an option in the given select box.
|
1608 |
+
*
|
1609 |
+
* @param $select
|
1610 |
+
* @param $option
|
1611 |
+
* @see \Codeception\Module\WebDriver::unselectOption()
|
1612 |
+
*/
|
1613 |
+
public function unselectOption($select, $option) {
|
1614 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('unselectOption', func_get_args()));
|
1615 |
+
}
|
1616 |
+
|
1617 |
+
|
1618 |
+
/**
|
1619 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1620 |
+
*
|
1621 |
+
* Ticks a checkbox. For radio buttons, use the `selectOption` method instead.
|
1622 |
+
*
|
1623 |
+
* ``` php
|
1624 |
+
* <?php
|
1625 |
+
* $I->checkOption('#agree');
|
1626 |
+
* ?>
|
1627 |
+
* ```
|
1628 |
+
*
|
1629 |
+
* @param $option
|
1630 |
+
* @see \Codeception\Module\WebDriver::checkOption()
|
1631 |
+
*/
|
1632 |
+
public function checkOption($option) {
|
1633 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args()));
|
1634 |
+
}
|
1635 |
+
|
1636 |
+
|
1637 |
+
/**
|
1638 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1639 |
+
*
|
1640 |
+
* Unticks a checkbox.
|
1641 |
+
*
|
1642 |
+
* ``` php
|
1643 |
+
* <?php
|
1644 |
+
* $I->uncheckOption('#notify');
|
1645 |
+
* ?>
|
1646 |
+
* ```
|
1647 |
+
*
|
1648 |
+
* @param $option
|
1649 |
+
* @see \Codeception\Module\WebDriver::uncheckOption()
|
1650 |
+
*/
|
1651 |
+
public function uncheckOption($option) {
|
1652 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
|
1653 |
+
}
|
1654 |
+
|
1655 |
+
|
1656 |
+
/**
|
1657 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1658 |
+
*
|
1659 |
+
* Fills a text field or textarea with the given string.
|
1660 |
+
*
|
1661 |
+
* ``` php
|
1662 |
+
* <?php
|
1663 |
+
* $I->fillField("//input[@type='text']", "Hello World!");
|
1664 |
+
* $I->fillField(['name' => 'email'], 'jon@mail.com');
|
1665 |
+
* ?>
|
1666 |
+
* ```
|
1667 |
+
*
|
1668 |
+
* @param $field
|
1669 |
+
* @param $value
|
1670 |
+
* @see \Codeception\Module\WebDriver::fillField()
|
1671 |
+
*/
|
1672 |
+
public function fillField($field, $value) {
|
1673 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args()));
|
1674 |
+
}
|
1675 |
+
|
1676 |
+
|
1677 |
+
/**
|
1678 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1679 |
+
*
|
1680 |
+
* Clears given field which isn't empty.
|
1681 |
+
*
|
1682 |
+
* ``` php
|
1683 |
+
* <?php
|
1684 |
+
* $I->clearField('#username');
|
1685 |
+
* ```
|
1686 |
+
*
|
1687 |
+
* @param $field
|
1688 |
+
* @see \Codeception\Module\WebDriver::clearField()
|
1689 |
+
*/
|
1690 |
+
public function clearField($field) {
|
1691 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('clearField', func_get_args()));
|
1692 |
+
}
|
1693 |
+
|
1694 |
+
|
1695 |
+
/**
|
1696 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1697 |
+
*
|
1698 |
+
* Attaches a file relative to the Codeception `_data` directory to the given file upload field.
|
1699 |
+
*
|
1700 |
+
* ``` php
|
1701 |
+
* <?php
|
1702 |
+
* // file is stored in 'tests/_data/prices.xls'
|
1703 |
+
* $I->attachFile('input[@type="file"]', 'prices.xls');
|
1704 |
+
* ?>
|
1705 |
+
* ```
|
1706 |
+
*
|
1707 |
+
* @param $field
|
1708 |
+
* @param $filename
|
1709 |
+
* @see \Codeception\Module\WebDriver::attachFile()
|
1710 |
+
*/
|
1711 |
+
public function attachFile($field, $filename) {
|
1712 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args()));
|
1713 |
+
}
|
1714 |
+
|
1715 |
+
|
1716 |
+
/**
|
1717 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1718 |
+
*
|
1719 |
+
* Finds and returns the text contents of the given element.
|
1720 |
+
* If a fuzzy locator is used, the element is found using CSS, XPath,
|
1721 |
+
* and by matching the full page source by regular expression.
|
1722 |
+
*
|
1723 |
+
* ``` php
|
1724 |
+
* <?php
|
1725 |
+
* $heading = $I->grabTextFrom('h1');
|
1726 |
+
* $heading = $I->grabTextFrom('descendant-or-self::h1');
|
1727 |
+
* $value = $I->grabTextFrom('~<input value=(.*?)]~sgi'); // match with a regex
|
1728 |
+
* ?>
|
1729 |
+
* ```
|
1730 |
+
*
|
1731 |
+
* @param $cssOrXPathOrRegex
|
1732 |
+
*
|
1733 |
+
* @return mixed
|
1734 |
+
* @see \Codeception\Module\WebDriver::grabTextFrom()
|
1735 |
+
*/
|
1736 |
+
public function grabTextFrom($cssOrXPathOrRegex) {
|
1737 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
|
1738 |
+
}
|
1739 |
+
|
1740 |
+
|
1741 |
+
/**
|
1742 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1743 |
+
*
|
1744 |
+
* Grabs the value of the given attribute value from the given element.
|
1745 |
+
* Fails if element is not found.
|
1746 |
+
*
|
1747 |
+
* ``` php
|
1748 |
+
* <?php
|
1749 |
+
* $I->grabAttributeFrom('#tooltip', 'title');
|
1750 |
+
* ?>
|
1751 |
+
* ```
|
1752 |
+
*
|
1753 |
+
*
|
1754 |
+
* @param $cssOrXpath
|
1755 |
+
* @param $attribute
|
1756 |
+
*
|
1757 |
+
* @return mixed
|
1758 |
+
* @see \Codeception\Module\WebDriver::grabAttributeFrom()
|
1759 |
+
*/
|
1760 |
+
public function grabAttributeFrom($cssOrXpath, $attribute) {
|
1761 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args()));
|
1762 |
+
}
|
1763 |
+
|
1764 |
+
|
1765 |
+
/**
|
1766 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1767 |
+
*
|
1768 |
+
* Finds the value for the given form field.
|
1769 |
+
* If a fuzzy locator is used, the field is found by field name, CSS, and XPath.
|
1770 |
+
*
|
1771 |
+
* ``` php
|
1772 |
+
* <?php
|
1773 |
+
* $name = $I->grabValueFrom('Name');
|
1774 |
+
* $name = $I->grabValueFrom('input[name=username]');
|
1775 |
+
* $name = $I->grabValueFrom('descendant-or-self::form/descendant::input[@name = 'username']');
|
1776 |
+
* $name = $I->grabValueFrom(['name' => 'username']);
|
1777 |
+
* ?>
|
1778 |
+
* ```
|
1779 |
+
*
|
1780 |
+
* @param $field
|
1781 |
+
*
|
1782 |
+
* @return mixed
|
1783 |
+
* @see \Codeception\Module\WebDriver::grabValueFrom()
|
1784 |
+
*/
|
1785 |
+
public function grabValueFrom($field) {
|
1786 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
|
1787 |
+
}
|
1788 |
+
|
1789 |
+
|
1790 |
+
/**
|
1791 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1792 |
+
*
|
1793 |
+
* Grabs either the text content, or attribute values, of nodes
|
1794 |
+
* matched by $cssOrXpath and returns them as an array.
|
1795 |
+
*
|
1796 |
+
* ```html
|
1797 |
+
* <a href="#first">First</a>
|
1798 |
+
* <a href="#second">Second</a>
|
1799 |
+
* <a href="#third">Third</a>
|
1800 |
+
* ```
|
1801 |
+
*
|
1802 |
+
* ```php
|
1803 |
+
* <?php
|
1804 |
+
* // would return ['First', 'Second', 'Third']
|
1805 |
+
* $aLinkText = $I->grabMultiple('a');
|
1806 |
+
*
|
1807 |
+
* // would return ['#first', '#second', '#third']
|
1808 |
+
* $aLinks = $I->grabMultiple('a', 'href');
|
1809 |
+
* ?>
|
1810 |
+
* ```
|
1811 |
+
*
|
1812 |
+
* @param $cssOrXpath
|
1813 |
+
* @param $attribute
|
1814 |
+
* @return string[]
|
1815 |
+
* @see \Codeception\Module\WebDriver::grabMultiple()
|
1816 |
+
*/
|
1817 |
+
public function grabMultiple($cssOrXpath, $attribute = null) {
|
1818 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args()));
|
1819 |
+
}
|
1820 |
+
|
1821 |
+
|
1822 |
+
/**
|
1823 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1824 |
+
*
|
1825 |
+
* Checks that the given element exists on the page and is visible.
|
1826 |
+
* You can also specify expected attributes of this element.
|
1827 |
+
*
|
1828 |
+
* ``` php
|
1829 |
+
* <?php
|
1830 |
+
* $I->seeElement('.error');
|
1831 |
+
* $I->seeElement('//form/input[1]');
|
1832 |
+
* $I->seeElement('input', ['name' => 'login']);
|
1833 |
+
* $I->seeElement('input', ['value' => '123456']);
|
1834 |
+
*
|
1835 |
+
* // strict locator in first arg, attributes in second
|
1836 |
+
* $I->seeElement(['css' => 'form input'], ['name' => 'login']);
|
1837 |
+
* ?>
|
1838 |
+
* ```
|
1839 |
+
*
|
1840 |
+
* @param $selector
|
1841 |
+
* @param array $attributes
|
1842 |
+
* @return
|
1843 |
+
* @see \Codeception\Module\WebDriver::seeElement()
|
1844 |
+
*/
|
1845 |
+
public function seeElement($selector, $attributes = null) {
|
1846 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
|
1847 |
+
}
|
1848 |
+
/**
|
1849 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1850 |
+
*
|
1851 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1852 |
+
* Checks that the given element exists on the page and is visible.
|
1853 |
+
* You can also specify expected attributes of this element.
|
1854 |
+
*
|
1855 |
+
* ``` php
|
1856 |
+
* <?php
|
1857 |
+
* $I->seeElement('.error');
|
1858 |
+
* $I->seeElement('//form/input[1]');
|
1859 |
+
* $I->seeElement('input', ['name' => 'login']);
|
1860 |
+
* $I->seeElement('input', ['value' => '123456']);
|
1861 |
+
*
|
1862 |
+
* // strict locator in first arg, attributes in second
|
1863 |
+
* $I->seeElement(['css' => 'form input'], ['name' => 'login']);
|
1864 |
+
* ?>
|
1865 |
+
* ```
|
1866 |
+
*
|
1867 |
+
* @param $selector
|
1868 |
+
* @param array $attributes
|
1869 |
+
* @return
|
1870 |
+
* @see \Codeception\Module\WebDriver::seeElement()
|
1871 |
+
*/
|
1872 |
+
public function canSeeElement($selector, $attributes = null) {
|
1873 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
|
1874 |
+
}
|
1875 |
+
|
1876 |
+
|
1877 |
+
/**
|
1878 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1879 |
+
*
|
1880 |
+
* Checks that the given element is invisible or not present on the page.
|
1881 |
+
* You can also specify expected attributes of this element.
|
1882 |
+
*
|
1883 |
+
* ``` php
|
1884 |
+
* <?php
|
1885 |
+
* $I->dontSeeElement('.error');
|
1886 |
+
* $I->dontSeeElement('//form/input[1]');
|
1887 |
+
* $I->dontSeeElement('input', ['name' => 'login']);
|
1888 |
+
* $I->dontSeeElement('input', ['value' => '123456']);
|
1889 |
+
* ?>
|
1890 |
+
* ```
|
1891 |
+
*
|
1892 |
+
* @param $selector
|
1893 |
+
* @param array $attributes
|
1894 |
+
* @see \Codeception\Module\WebDriver::dontSeeElement()
|
1895 |
+
*/
|
1896 |
+
public function dontSeeElement($selector, $attributes = null) {
|
1897 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElement', func_get_args()));
|
1898 |
+
}
|
1899 |
+
/**
|
1900 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1901 |
+
*
|
1902 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1903 |
+
* Checks that the given element is invisible or not present on the page.
|
1904 |
+
* You can also specify expected attributes of this element.
|
1905 |
+
*
|
1906 |
+
* ``` php
|
1907 |
+
* <?php
|
1908 |
+
* $I->dontSeeElement('.error');
|
1909 |
+
* $I->dontSeeElement('//form/input[1]');
|
1910 |
+
* $I->dontSeeElement('input', ['name' => 'login']);
|
1911 |
+
* $I->dontSeeElement('input', ['value' => '123456']);
|
1912 |
+
* ?>
|
1913 |
+
* ```
|
1914 |
+
*
|
1915 |
+
* @param $selector
|
1916 |
+
* @param array $attributes
|
1917 |
+
* @see \Codeception\Module\WebDriver::dontSeeElement()
|
1918 |
+
*/
|
1919 |
+
public function cantSeeElement($selector, $attributes = null) {
|
1920 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
|
1921 |
+
}
|
1922 |
+
|
1923 |
+
|
1924 |
+
/**
|
1925 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1926 |
+
*
|
1927 |
+
* Checks that the given element exists on the page, even it is invisible.
|
1928 |
+
*
|
1929 |
+
* ``` php
|
1930 |
+
* <?php
|
1931 |
+
* $I->seeElementInDOM('//form/input[type=hidden]');
|
1932 |
+
* ?>
|
1933 |
+
* ```
|
1934 |
+
*
|
1935 |
+
* @param $selector
|
1936 |
+
* @param array $attributes
|
1937 |
+
* @see \Codeception\Module\WebDriver::seeElementInDOM()
|
1938 |
+
*/
|
1939 |
+
public function seeElementInDOM($selector, $attributes = null) {
|
1940 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElementInDOM', func_get_args()));
|
1941 |
+
}
|
1942 |
+
/**
|
1943 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1944 |
+
*
|
1945 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1946 |
+
* Checks that the given element exists on the page, even it is invisible.
|
1947 |
+
*
|
1948 |
+
* ``` php
|
1949 |
+
* <?php
|
1950 |
+
* $I->seeElementInDOM('//form/input[type=hidden]');
|
1951 |
+
* ?>
|
1952 |
+
* ```
|
1953 |
+
*
|
1954 |
+
* @param $selector
|
1955 |
+
* @param array $attributes
|
1956 |
+
* @see \Codeception\Module\WebDriver::seeElementInDOM()
|
1957 |
+
*/
|
1958 |
+
public function canSeeElementInDOM($selector, $attributes = null) {
|
1959 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElementInDOM', func_get_args()));
|
1960 |
+
}
|
1961 |
+
|
1962 |
+
|
1963 |
+
/**
|
1964 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1965 |
+
*
|
1966 |
+
* Opposite of `seeElementInDOM`.
|
1967 |
+
*
|
1968 |
+
* @param $selector
|
1969 |
+
* @param array $attributes
|
1970 |
+
* @see \Codeception\Module\WebDriver::dontSeeElementInDOM()
|
1971 |
+
*/
|
1972 |
+
public function dontSeeElementInDOM($selector, $attributes = null) {
|
1973 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElementInDOM', func_get_args()));
|
1974 |
+
}
|
1975 |
+
/**
|
1976 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1977 |
+
*
|
1978 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
1979 |
+
* Opposite of `seeElementInDOM`.
|
1980 |
+
*
|
1981 |
+
* @param $selector
|
1982 |
+
* @param array $attributes
|
1983 |
+
* @see \Codeception\Module\WebDriver::dontSeeElementInDOM()
|
1984 |
+
*/
|
1985 |
+
public function cantSeeElementInDOM($selector, $attributes = null) {
|
1986 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElementInDOM', func_get_args()));
|
1987 |
+
}
|
1988 |
+
|
1989 |
+
|
1990 |
+
/**
|
1991 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
1992 |
+
*
|
1993 |
+
* Checks that there are a certain number of elements matched by the given locator on the page.
|
1994 |
+
*
|
1995 |
+
* ``` php
|
1996 |
+
* <?php
|
1997 |
+
* $I->seeNumberOfElements('tr', 10);
|
1998 |
+
* $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements
|
1999 |
+
* ?>
|
2000 |
+
* ```
|
2001 |
+
* @param $selector
|
2002 |
+
* @param mixed $expected int or int[]
|
2003 |
+
* @see \Codeception\Module\WebDriver::seeNumberOfElements()
|
2004 |
+
*/
|
2005 |
+
public function seeNumberOfElements($selector, $expected) {
|
2006 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args()));
|
2007 |
+
}
|
2008 |
+
/**
|
2009 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2010 |
+
*
|
2011 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
2012 |
+
* Checks that there are a certain number of elements matched by the given locator on the page.
|
2013 |
+
*
|
2014 |
+
* ``` php
|
2015 |
+
* <?php
|
2016 |
+
* $I->seeNumberOfElements('tr', 10);
|
2017 |
+
* $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements
|
2018 |
+
* ?>
|
2019 |
+
* ```
|
2020 |
+
* @param $selector
|
2021 |
+
* @param mixed $expected int or int[]
|
2022 |
+
* @see \Codeception\Module\WebDriver::seeNumberOfElements()
|
2023 |
+
*/
|
2024 |
+
public function canSeeNumberOfElements($selector, $expected) {
|
2025 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args()));
|
2026 |
+
}
|
2027 |
+
|
2028 |
+
|
2029 |
+
/**
|
2030 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2031 |
+
*
|
2032 |
+
*
|
2033 |
+
* @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM()
|
2034 |
+
*/
|
2035 |
+
public function seeNumberOfElementsInDOM($selector, $expected) {
|
2036 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElementsInDOM', func_get_args()));
|
2037 |
+
}
|
2038 |
+
/**
|
2039 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2040 |
+
*
|
2041 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
2042 |
+
*
|
2043 |
+
* @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM()
|
2044 |
+
*/
|
2045 |
+
public function canSeeNumberOfElementsInDOM($selector, $expected) {
|
2046 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElementsInDOM', func_get_args()));
|
2047 |
+
}
|
2048 |
+
|
2049 |
+
|
2050 |
+
/**
|
2051 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2052 |
+
*
|
2053 |
+
* Checks that the given option is selected.
|
2054 |
+
*
|
2055 |
+
* ``` php
|
2056 |
+
* <?php
|
2057 |
+
* $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
|
2058 |
+
* ?>
|
2059 |
+
* ```
|
2060 |
+
*
|
2061 |
+
* @param $selector
|
2062 |
+
* @param $optionText
|
2063 |
+
*
|
2064 |
+
* @return mixed
|
2065 |
+
* @see \Codeception\Module\WebDriver::seeOptionIsSelected()
|
2066 |
+
*/
|
2067 |
+
public function seeOptionIsSelected($selector, $optionText) {
|
2068 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
|
2069 |
+
}
|
2070 |
+
/**
|
2071 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2072 |
+
*
|
2073 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
2074 |
+
* Checks that the given option is selected.
|
2075 |
+
*
|
2076 |
+
* ``` php
|
2077 |
+
* <?php
|
2078 |
+
* $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
|
2079 |
+
* ?>
|
2080 |
+
* ```
|
2081 |
+
*
|
2082 |
+
* @param $selector
|
2083 |
+
* @param $optionText
|
2084 |
+
*
|
2085 |
+
* @return mixed
|
2086 |
+
* @see \Codeception\Module\WebDriver::seeOptionIsSelected()
|
2087 |
+
*/
|
2088 |
+
public function canSeeOptionIsSelected($selector, $optionText) {
|
2089 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
|
2090 |
+
}
|
2091 |
+
|
2092 |
+
|
2093 |
+
/**
|
2094 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2095 |
+
*
|
2096 |
+
* Checks that the given option is not selected.
|
2097 |
+
*
|
2098 |
+
* ``` php
|
2099 |
+
* <?php
|
2100 |
+
* $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
|
2101 |
+
* ?>
|
2102 |
+
* ```
|
2103 |
+
*
|
2104 |
+
* @param $selector
|
2105 |
+
* @param $optionText
|
2106 |
+
*
|
2107 |
+
* @return mixed
|
2108 |
+
* @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected()
|
2109 |
+
*/
|
2110 |
+
public function dontSeeOptionIsSelected($selector, $optionText) {
|
2111 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeOptionIsSelected', func_get_args()));
|
2112 |
+
}
|
2113 |
+
/**
|
2114 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2115 |
+
*
|
2116 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
2117 |
+
* Checks that the given option is not selected.
|
2118 |
+
*
|
2119 |
+
* ``` php
|
2120 |
+
* <?php
|
2121 |
+
* $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
|
2122 |
+
* ?>
|
2123 |
+
* ```
|
2124 |
+
*
|
2125 |
+
* @param $selector
|
2126 |
+
* @param $optionText
|
2127 |
+
*
|
2128 |
+
* @return mixed
|
2129 |
+
* @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected()
|
2130 |
+
*/
|
2131 |
+
public function cantSeeOptionIsSelected($selector, $optionText) {
|
2132 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
|
2133 |
+
}
|
2134 |
+
|
2135 |
+
|
2136 |
+
/**
|
2137 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2138 |
+
*
|
2139 |
+
* Checks that the page title contains the given string.
|
2140 |
+
*
|
2141 |
+
* ``` php
|
2142 |
+
* <?php
|
2143 |
+
* $I->seeInTitle('Blog - Post #1');
|
2144 |
+
* ?>
|
2145 |
+
* ```
|
2146 |
+
*
|
2147 |
+
* @param $title
|
2148 |
+
*
|
2149 |
+
* @return mixed
|
2150 |
+
* @see \Codeception\Module\WebDriver::seeInTitle()
|
2151 |
+
*/
|
2152 |
+
public function seeInTitle($title) {
|
2153 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
|
2154 |
+
}
|
2155 |
+
/**
|
2156 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2157 |
+
*
|
2158 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
2159 |
+
* Checks that the page title contains the given string.
|
2160 |
+
*
|
2161 |
+
* ``` php
|
2162 |
+
* <?php
|
2163 |
+
* $I->seeInTitle('Blog - Post #1');
|
2164 |
+
* ?>
|
2165 |
+
* ```
|
2166 |
+
*
|
2167 |
+
* @param $title
|
2168 |
+
*
|
2169 |
+
* @return mixed
|
2170 |
+
* @see \Codeception\Module\WebDriver::seeInTitle()
|
2171 |
+
*/
|
2172 |
+
public function canSeeInTitle($title) {
|
2173 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
|
2174 |
+
}
|
2175 |
+
|
2176 |
+
|
2177 |
+
/**
|
2178 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2179 |
+
*
|
2180 |
+
* Checks that the page title does not contain the given string.
|
2181 |
+
*
|
2182 |
+
* @param $title
|
2183 |
+
*
|
2184 |
+
* @return mixed
|
2185 |
+
* @see \Codeception\Module\WebDriver::dontSeeInTitle()
|
2186 |
+
*/
|
2187 |
+
public function dontSeeInTitle($title) {
|
2188 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInTitle', func_get_args()));
|
2189 |
+
}
|
2190 |
+
/**
|
2191 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2192 |
+
*
|
2193 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
2194 |
+
* Checks that the page title does not contain the given string.
|
2195 |
+
*
|
2196 |
+
* @param $title
|
2197 |
+
*
|
2198 |
+
* @return mixed
|
2199 |
+
* @see \Codeception\Module\WebDriver::dontSeeInTitle()
|
2200 |
+
*/
|
2201 |
+
public function cantSeeInTitle($title) {
|
2202 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
|
2203 |
+
}
|
2204 |
+
|
2205 |
+
|
2206 |
+
/**
|
2207 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2208 |
+
*
|
2209 |
+
* Accepts the active JavaScript native popup window, as created by `window.alert`|`window.confirm`|`window.prompt`.
|
2210 |
+
* Don't confuse popups with modal windows,
|
2211 |
+
* as created by [various libraries](http://jster.net/category/windows-modals-popups).
|
2212 |
+
* @see \Codeception\Module\WebDriver::acceptPopup()
|
2213 |
+
*/
|
2214 |
+
public function acceptPopup() {
|
2215 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('acceptPopup', func_get_args()));
|
2216 |
+
}
|
2217 |
+
|
2218 |
+
|
2219 |
+
/**
|
2220 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2221 |
+
*
|
2222 |
+
* Dismisses the active JavaScript popup, as created by `window.alert`, `window.confirm`, or `window.prompt`.
|
2223 |
+
* @see \Codeception\Module\WebDriver::cancelPopup()
|
2224 |
+
*/
|
2225 |
+
public function cancelPopup() {
|
2226 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('cancelPopup', func_get_args()));
|
2227 |
+
}
|
2228 |
+
|
2229 |
+
|
2230 |
+
/**
|
2231 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2232 |
+
*
|
2233 |
+
* Checks that the active JavaScript popup,
|
2234 |
+
* as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
|
2235 |
+
*
|
2236 |
+
* @param $text
|
2237 |
+
*
|
2238 |
+
* @throws \Codeception\Exception\ModuleException
|
2239 |
+
* @see \Codeception\Module\WebDriver::seeInPopup()
|
2240 |
+
*/
|
2241 |
+
public function seeInPopup($text) {
|
2242 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPopup', func_get_args()));
|
2243 |
+
}
|
2244 |
+
/**
|
2245 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2246 |
+
*
|
2247 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
2248 |
+
* Checks that the active JavaScript popup,
|
2249 |
+
* as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string.
|
2250 |
+
*
|
2251 |
+
* @param $text
|
2252 |
+
*
|
2253 |
+
* @throws \Codeception\Exception\ModuleException
|
2254 |
+
* @see \Codeception\Module\WebDriver::seeInPopup()
|
2255 |
+
*/
|
2256 |
+
public function canSeeInPopup($text) {
|
2257 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPopup', func_get_args()));
|
2258 |
+
}
|
2259 |
+
|
2260 |
+
|
2261 |
+
/**
|
2262 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2263 |
+
*
|
2264 |
+
* Checks that the active JavaScript popup,
|
2265 |
+
* as created by `window.alert`|`window.confirm`|`window.prompt`, does NOT contain the given string.
|
2266 |
+
*
|
2267 |
+
* @param $text
|
2268 |
+
*
|
2269 |
+
* @throws \Codeception\Exception\ModuleException
|
2270 |
+
* @see \Codeception\Module\WebDriver::dontSeeInPopup()
|
2271 |
+
*/
|
2272 |
+
public function dontSeeInPopup($text) {
|
2273 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInPopup', func_get_args()));
|
2274 |
+
}
|
2275 |
+
/**
|
2276 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2277 |
+
*
|
2278 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
2279 |
+
* Checks that the active JavaScript popup,
|
2280 |
+
* as created by `window.alert`|`window.confirm`|`window.prompt`, does NOT contain the given string.
|
2281 |
+
*
|
2282 |
+
* @param $text
|
2283 |
+
*
|
2284 |
+
* @throws \Codeception\Exception\ModuleException
|
2285 |
+
* @see \Codeception\Module\WebDriver::dontSeeInPopup()
|
2286 |
+
*/
|
2287 |
+
public function cantSeeInPopup($text) {
|
2288 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPopup', func_get_args()));
|
2289 |
+
}
|
2290 |
+
|
2291 |
+
|
2292 |
+
/**
|
2293 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2294 |
+
*
|
2295 |
+
* Enters text into a native JavaScript prompt popup, as created by `window.prompt`.
|
2296 |
+
*
|
2297 |
+
* @param $keys
|
2298 |
+
*
|
2299 |
+
* @throws \Codeception\Exception\ModuleException
|
2300 |
+
* @see \Codeception\Module\WebDriver::typeInPopup()
|
2301 |
+
*/
|
2302 |
+
public function typeInPopup($keys) {
|
2303 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('typeInPopup', func_get_args()));
|
2304 |
+
}
|
2305 |
+
|
2306 |
+
|
2307 |
+
/**
|
2308 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2309 |
+
*
|
2310 |
+
* Reloads the current page.
|
2311 |
+
* @see \Codeception\Module\WebDriver::reloadPage()
|
2312 |
+
*/
|
2313 |
+
public function reloadPage() {
|
2314 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('reloadPage', func_get_args()));
|
2315 |
+
}
|
2316 |
+
|
2317 |
+
|
2318 |
+
/**
|
2319 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2320 |
+
*
|
2321 |
+
* Moves back in history.
|
2322 |
+
* @see \Codeception\Module\WebDriver::moveBack()
|
2323 |
+
*/
|
2324 |
+
public function moveBack() {
|
2325 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args()));
|
2326 |
+
}
|
2327 |
+
|
2328 |
+
|
2329 |
+
/**
|
2330 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2331 |
+
*
|
2332 |
+
* Moves forward in history.
|
2333 |
+
* @see \Codeception\Module\WebDriver::moveForward()
|
2334 |
+
*/
|
2335 |
+
public function moveForward() {
|
2336 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('moveForward', func_get_args()));
|
2337 |
+
}
|
2338 |
+
|
2339 |
+
|
2340 |
+
/**
|
2341 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2342 |
+
*
|
2343 |
+
* Submits the given form on the page, optionally with the given form
|
2344 |
+
* values. Give the form fields values as an array. Note that hidden fields
|
2345 |
+
* can't be accessed.
|
2346 |
+
*
|
2347 |
+
* Skipped fields will be filled by their values from the page.
|
2348 |
+
* You don't need to click the 'Submit' button afterwards.
|
2349 |
+
* This command itself triggers the request to form's action.
|
2350 |
+
*
|
2351 |
+
* You can optionally specify what button's value to include
|
2352 |
+
* in the request with the last parameter as an alternative to
|
2353 |
+
* explicitly setting its value in the second parameter, as
|
2354 |
+
* button values are not otherwise included in the request.
|
2355 |
+
*
|
2356 |
+
* Examples:
|
2357 |
+
*
|
2358 |
+
* ``` php
|
2359 |
+
* <?php
|
2360 |
+
* $I->submitForm('#login', [
|
2361 |
+
* 'login' => 'davert',
|
2362 |
+
* 'password' => '123456'
|
2363 |
+
* ]);
|
2364 |
+
* // or
|
2365 |
+
* $I->submitForm('#login', [
|
2366 |
+
* 'login' => 'davert',
|
2367 |
+
* 'password' => '123456'
|
2368 |
+
* ], 'submitButtonName');
|
2369 |
+
*
|
2370 |
+
* ```
|
2371 |
+
*
|
2372 |
+
* For example, given this sample "Sign Up" form:
|
2373 |
+
*
|
2374 |
+
* ``` html
|
2375 |
+
* <form action="/sign_up">
|
2376 |
+
* Login:
|
2377 |
+
* <input type="text" name="user[login]" /><br/>
|
2378 |
+
* Password:
|
2379 |
+
* <input type="password" name="user[password]" /><br/>
|
2380 |
+
* Do you agree to our terms?
|
2381 |
+
* <input type="checkbox" name="user[agree]" /><br/>
|
2382 |
+
* Select pricing plan:
|
2383 |
+
* <select name="plan">
|
2384 |
+
* <option value="1">Free</option>
|
2385 |
+
* <option value="2" selected="selected">Paid</option>
|
2386 |
+
* </select>
|
2387 |
+
* <input type="submit" name="submitButton" value="Submit" />
|
2388 |
+
* </form>
|
2389 |
+
* ```
|
2390 |
+
*
|
2391 |
+
* You could write the following to submit it:
|
2392 |
+
*
|
2393 |
+
* ``` php
|
2394 |
+
* <?php
|
2395 |
+
* $I->submitForm(
|
2396 |
+
* '#userForm',
|
2397 |
+
* [
|
2398 |
+
* 'user[login]' => 'Davert',
|
2399 |
+
* 'user[password]' => '123456',
|
2400 |
+
* 'user[agree]' => true
|
2401 |
+
* ],
|
2402 |
+
* 'submitButton'
|
2403 |
+
* );
|
2404 |
+
* ```
|
2405 |
+
* Note that "2" will be the submitted value for the "plan" field, as it is
|
2406 |
+
* the selected option.
|
2407 |
+
*
|
2408 |
+
* Also note that this differs from PhpBrowser, in that
|
2409 |
+
* ```'user' => [ 'login' => 'Davert' ]``` is not supported at the moment.
|
2410 |
+
* Named array keys *must* be included in the name as above.
|
2411 |
+
*
|
2412 |
+
* Pair this with seeInFormFields for quick testing magic.
|
2413 |
+
*
|
2414 |
+
* ``` php
|
2415 |
+
* <?php
|
2416 |
+
* $form = [
|
2417 |
+
* 'field1' => 'value',
|
2418 |
+
* 'field2' => 'another value',
|
2419 |
+
* 'checkbox1' => true,
|
2420 |
+
* // ...
|
2421 |
+
* ];
|
2422 |
+
* $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
|
2423 |
+
* // $I->amOnPage('/path/to/form-page') may be needed
|
2424 |
+
* $I->seeInFormFields('//form[@id=my-form]', $form);
|
2425 |
+
* ?>
|
2426 |
+
* ```
|
2427 |
+
*
|
2428 |
+
* Parameter values must be set to arrays for multiple input fields
|
2429 |
+
* of the same name, or multi-select combo boxes. For checkboxes,
|
2430 |
+
* either the string value can be used, or boolean values which will
|
2431 |
+
* be replaced by the checkbox's value in the DOM.
|
2432 |
+
*
|
2433 |
+
* ``` php
|
2434 |
+
* <?php
|
2435 |
+
* $I->submitForm('#my-form', [
|
2436 |
+
* 'field1' => 'value',
|
2437 |
+
* 'checkbox' => [
|
2438 |
+
* 'value of first checkbox',
|
2439 |
+
* 'value of second checkbox',
|
2440 |
+
* ],
|
2441 |
+
* 'otherCheckboxes' => [
|
2442 |
+
* true,
|
2443 |
+
* false,
|
2444 |
+
* false,
|
2445 |
+
* ],
|
2446 |
+
* 'multiselect' => [
|
2447 |
+
* 'first option value',
|
2448 |
+
* 'second option value',
|
2449 |
+
* ]
|
2450 |
+
* ]);
|
2451 |
+
* ?>
|
2452 |
+
* ```
|
2453 |
+
*
|
2454 |
+
* Mixing string and boolean values for a checkbox's value is not supported
|
2455 |
+
* and may produce unexpected results.
|
2456 |
+
*
|
2457 |
+
* Field names ending in "[]" must be passed without the trailing square
|
2458 |
+
* bracket characters, and must contain an array for its value. This allows
|
2459 |
+
* submitting multiple values with the same name, consider:
|
2460 |
+
*
|
2461 |
+
* ```php
|
2462 |
+
* $I->submitForm('#my-form', [
|
2463 |
+
* 'field[]' => 'value',
|
2464 |
+
* 'field[]' => 'another value', // 'field[]' is already a defined key
|
2465 |
+
* ]);
|
2466 |
+
* ```
|
2467 |
+
*
|
2468 |
+
* The solution is to pass an array value:
|
2469 |
+
*
|
2470 |
+
* ```php
|
2471 |
+
* // this way both values are submitted
|
2472 |
+
* $I->submitForm('#my-form', [
|
2473 |
+
* 'field' => [
|
2474 |
+
* 'value',
|
2475 |
+
* 'another value',
|
2476 |
+
* ]
|
2477 |
+
* ]);
|
2478 |
+
* ```
|
2479 |
+
*
|
2480 |
+
* The `$button` parameter can be either a string, an array or an instance
|
2481 |
+
* of Facebook\WebDriver\WebDriverBy. When it is a string, the
|
2482 |
+
* button will be found by its "name" attribute. If $button is an
|
2483 |
+
* array then it will be treated as a strict selector and a WebDriverBy
|
2484 |
+
* will be used verbatim.
|
2485 |
+
*
|
2486 |
+
* For example, given the following HTML:
|
2487 |
+
*
|
2488 |
+
* ``` html
|
2489 |
+
* <input type="submit" name="submitButton" value="Submit" />
|
2490 |
+
* ```
|
2491 |
+
*
|
2492 |
+
* `$button` could be any one of the following:
|
2493 |
+
* - 'submitButton'
|
2494 |
+
* - ['name' => 'submitButton']
|
2495 |
+
* - WebDriverBy::name('submitButton')
|
2496 |
+
*
|
2497 |
+
* @param $selector
|
2498 |
+
* @param $params
|
2499 |
+
* @param $button
|
2500 |
+
* @see \Codeception\Module\WebDriver::submitForm()
|
2501 |
+
*/
|
2502 |
+
public function submitForm($selector, $params, $button = null) {
|
2503 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
|
2504 |
+
}
|
2505 |
+
|
2506 |
+
|
2507 |
+
/**
|
2508 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2509 |
+
*
|
2510 |
+
* Waits up to $timeout seconds for the given element to change.
|
2511 |
+
* Element "change" is determined by a callback function which is called repeatedly
|
2512 |
+
* until the return value evaluates to true.
|
2513 |
+
*
|
2514 |
+
* ``` php
|
2515 |
+
* <?php
|
2516 |
+
* use \Facebook\WebDriver\WebDriverElement
|
2517 |
+
* $I->waitForElementChange('#menu', function(WebDriverElement $el) {
|
2518 |
+
* return $el->isDisplayed();
|
2519 |
+
* }, 100);
|
2520 |
+
* ?>
|
2521 |
+
* ```
|
2522 |
+
*
|
2523 |
+
* @param $element
|
2524 |
+
* @param \Closure $callback
|
2525 |
+
* @param int $timeout seconds
|
2526 |
+
* @throws \Codeception\Exception\ElementNotFound
|
2527 |
+
* @see \Codeception\Module\WebDriver::waitForElementChange()
|
2528 |
+
*/
|
2529 |
+
public function waitForElementChange($element, $callback, $timeout = null) {
|
2530 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementChange', func_get_args()));
|
2531 |
+
}
|
2532 |
+
|
2533 |
+
|
2534 |
+
/**
|
2535 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2536 |
+
*
|
2537 |
+
* Waits up to $timeout seconds for an element to appear on the page.
|
2538 |
+
* If the element doesn't appear, a timeout exception is thrown.
|
2539 |
+
*
|
2540 |
+
* ``` php
|
2541 |
+
* <?php
|
2542 |
+
* $I->waitForElement('#agree_button', 30); // secs
|
2543 |
+
* $I->click('#agree_button');
|
2544 |
+
* ?>
|
2545 |
+
* ```
|
2546 |
+
*
|
2547 |
+
* @param $element
|
2548 |
+
* @param int $timeout seconds
|
2549 |
+
* @throws \Exception
|
2550 |
+
* @see \Codeception\Module\WebDriver::waitForElement()
|
2551 |
+
*/
|
2552 |
+
public function waitForElement($element, $timeout = null) {
|
2553 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElement', func_get_args()));
|
2554 |
+
}
|
2555 |
+
|
2556 |
+
|
2557 |
+
/**
|
2558 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2559 |
+
*
|
2560 |
+
* Waits up to $timeout seconds for the given element to be visible on the page.
|
2561 |
+
* If element doesn't appear, a timeout exception is thrown.
|
2562 |
+
*
|
2563 |
+
* ``` php
|
2564 |
+
* <?php
|
2565 |
+
* $I->waitForElementVisible('#agree_button', 30); // secs
|
2566 |
+
* $I->click('#agree_button');
|
2567 |
+
* ?>
|
2568 |
+
* ```
|
2569 |
+
*
|
2570 |
+
* @param $element
|
2571 |
+
* @param int $timeout seconds
|
2572 |
+
* @throws \Exception
|
2573 |
+
* @see \Codeception\Module\WebDriver::waitForElementVisible()
|
2574 |
+
*/
|
2575 |
+
public function waitForElementVisible($element, $timeout = null) {
|
2576 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementVisible', func_get_args()));
|
2577 |
+
}
|
2578 |
+
|
2579 |
+
|
2580 |
+
/**
|
2581 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2582 |
+
*
|
2583 |
+
* Waits up to $timeout seconds for the given element to become invisible.
|
2584 |
+
* If element stays visible, a timeout exception is thrown.
|
2585 |
+
*
|
2586 |
+
* ``` php
|
2587 |
+
* <?php
|
2588 |
+
* $I->waitForElementNotVisible('#agree_button', 30); // secs
|
2589 |
+
* ?>
|
2590 |
+
* ```
|
2591 |
+
*
|
2592 |
+
* @param $element
|
2593 |
+
* @param int $timeout seconds
|
2594 |
+
* @throws \Exception
|
2595 |
+
* @see \Codeception\Module\WebDriver::waitForElementNotVisible()
|
2596 |
+
*/
|
2597 |
+
public function waitForElementNotVisible($element, $timeout = null) {
|
2598 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementNotVisible', func_get_args()));
|
2599 |
+
}
|
2600 |
+
|
2601 |
+
|
2602 |
+
/**
|
2603 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2604 |
+
*
|
2605 |
+
* Waits up to $timeout seconds for the given element to be clickable.
|
2606 |
+
* If element doesn't become clickable, a timeout exception is thrown.
|
2607 |
+
*
|
2608 |
+
* ``` php
|
2609 |
+
* <?php
|
2610 |
+
* $I->waitForElementClickable('#agree_button', 30); // secs
|
2611 |
+
* $I->click('#agree_button');
|
2612 |
+
* ?>
|
2613 |
+
* ```
|
2614 |
+
*
|
2615 |
+
* @param $element
|
2616 |
+
* @param int $timeout seconds
|
2617 |
+
* @throws \Exception
|
2618 |
+
* @see \Codeception\Module\WebDriver::waitForElementClickable()
|
2619 |
+
*/
|
2620 |
+
public function waitForElementClickable($element, $timeout = null) {
|
2621 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementClickable', func_get_args()));
|
2622 |
+
}
|
2623 |
+
|
2624 |
+
|
2625 |
+
/**
|
2626 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2627 |
+
*
|
2628 |
+
* Waits up to $timeout seconds for the given string to appear on the page.
|
2629 |
+
*
|
2630 |
+
* Can also be passed a selector to search in, be as specific as possible when using selectors.
|
2631 |
+
* waitForText() will only watch the first instance of the matching selector / text provided.
|
2632 |
+
* If the given text doesn't appear, a timeout exception is thrown.
|
2633 |
+
*
|
2634 |
+
* ``` php
|
2635 |
+
* <?php
|
2636 |
+
* $I->waitForText('foo', 30); // secs
|
2637 |
+
* $I->waitForText('foo', 30, '.title'); // secs
|
2638 |
+
* ?>
|
2639 |
+
* ```
|
2640 |
+
*
|
2641 |
+
* @param string $text
|
2642 |
+
* @param int $timeout seconds
|
2643 |
+
* @param string $selector optional
|
2644 |
+
* @throws \Exception
|
2645 |
+
* @see \Codeception\Module\WebDriver::waitForText()
|
2646 |
+
*/
|
2647 |
+
public function waitForText($text, $timeout = null, $selector = null) {
|
2648 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForText', func_get_args()));
|
2649 |
+
}
|
2650 |
+
|
2651 |
+
|
2652 |
+
/**
|
2653 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2654 |
+
*
|
2655 |
+
* Wait for $timeout seconds.
|
2656 |
+
*
|
2657 |
+
* @param int|float $timeout secs
|
2658 |
+
* @throws \Codeception\Exception\TestRuntimeException
|
2659 |
+
* @see \Codeception\Module\WebDriver::wait()
|
2660 |
+
*/
|
2661 |
+
public function wait($timeout) {
|
2662 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('wait', func_get_args()));
|
2663 |
+
}
|
2664 |
+
|
2665 |
+
|
2666 |
+
/**
|
2667 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2668 |
+
*
|
2669 |
+
* Low-level API method.
|
2670 |
+
* If Codeception commands are not enough, this allows you to use Selenium WebDriver methods directly:
|
2671 |
+
*
|
2672 |
+
* ``` php
|
2673 |
+
* $I->executeInSelenium(function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
|
2674 |
+
* $webdriver->get('http://google.com');
|
2675 |
+
* });
|
2676 |
+
* ```
|
2677 |
+
*
|
2678 |
+
* This runs in the context of the
|
2679 |
+
* [RemoteWebDriver class](https://github.com/php-webdriver/php-webdriver/blob/master/lib/remote/RemoteWebDriver.php).
|
2680 |
+
* Try not to use this command on a regular basis.
|
2681 |
+
* If Codeception lacks a feature you need, please implement it and submit a patch.
|
2682 |
+
*
|
2683 |
+
* @param callable $function
|
2684 |
+
* @see \Codeception\Module\WebDriver::executeInSelenium()
|
2685 |
+
*/
|
2686 |
+
public function executeInSelenium($function) {
|
2687 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('executeInSelenium', func_get_args()));
|
2688 |
+
}
|
2689 |
+
|
2690 |
+
|
2691 |
+
/**
|
2692 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2693 |
+
*
|
2694 |
+
* Switch to another window identified by name.
|
2695 |
+
*
|
2696 |
+
* The window can only be identified by name. If the $name parameter is blank, the parent window will be used.
|
2697 |
+
*
|
2698 |
+
* Example:
|
2699 |
+
* ``` html
|
2700 |
+
* <input type="button" value="Open window" onclick="window.open('http://example.com', 'another_window')">
|
2701 |
+
* ```
|
2702 |
+
*
|
2703 |
+
* ``` php
|
2704 |
+
* <?php
|
2705 |
+
* $I->click("Open window");
|
2706 |
+
* # switch to another window
|
2707 |
+
* $I->switchToWindow("another_window");
|
2708 |
+
* # switch to parent window
|
2709 |
+
* $I->switchToWindow();
|
2710 |
+
* ?>
|
2711 |
+
* ```
|
2712 |
+
*
|
2713 |
+
* If the window has no name, match it by switching to next active tab using `switchToNextTab` method.
|
2714 |
+
*
|
2715 |
+
* Or use native Selenium functions to get access to all opened windows:
|
2716 |
+
*
|
2717 |
+
* ``` php
|
2718 |
+
* <?php
|
2719 |
+
* $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
|
2720 |
+
* $handles=$webdriver->getWindowHandles();
|
2721 |
+
* $last_window = end($handles);
|
2722 |
+
* $webdriver->switchTo()->window($last_window);
|
2723 |
+
* });
|
2724 |
+
* ?>
|
2725 |
+
* ```
|
2726 |
+
*
|
2727 |
+
* @param string|null $name
|
2728 |
+
* @see \Codeception\Module\WebDriver::switchToWindow()
|
2729 |
+
*/
|
2730 |
+
public function switchToWindow($name = null) {
|
2731 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToWindow', func_get_args()));
|
2732 |
+
}
|
2733 |
+
|
2734 |
+
|
2735 |
+
/**
|
2736 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2737 |
+
*
|
2738 |
+
* Switch to another frame on the page.
|
2739 |
+
*
|
2740 |
+
* Example:
|
2741 |
+
* ``` html
|
2742 |
+
* <iframe name="another_frame" id="fr1" src="http://example.com">
|
2743 |
+
*
|
2744 |
+
* ```
|
2745 |
+
*
|
2746 |
+
* ``` php
|
2747 |
+
* <?php
|
2748 |
+
* # switch to iframe by name
|
2749 |
+
* $I->switchToIFrame("another_frame");
|
2750 |
+
* # switch to iframe by CSS or XPath
|
2751 |
+
* $I->switchToIFrame("#fr1");
|
2752 |
+
* # switch to parent page
|
2753 |
+
* $I->switchToIFrame();
|
2754 |
+
*
|
2755 |
+
* ```
|
2756 |
+
*
|
2757 |
+
* @param string|null $locator (name, CSS or XPath)
|
2758 |
+
* @see \Codeception\Module\WebDriver::switchToIFrame()
|
2759 |
+
*/
|
2760 |
+
public function switchToIFrame($locator = null) {
|
2761 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToIFrame', func_get_args()));
|
2762 |
+
}
|
2763 |
+
|
2764 |
+
|
2765 |
+
/**
|
2766 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2767 |
+
*
|
2768 |
+
* Executes JavaScript and waits up to $timeout seconds for it to return true.
|
2769 |
+
*
|
2770 |
+
* In this example we will wait up to 60 seconds for all jQuery AJAX requests to finish.
|
2771 |
+
*
|
2772 |
+
* ``` php
|
2773 |
+
* <?php
|
2774 |
+
* $I->waitForJS("return $.active == 0;", 60);
|
2775 |
+
* ?>
|
2776 |
+
* ```
|
2777 |
+
*
|
2778 |
+
* @param string $script
|
2779 |
+
* @param int $timeout seconds
|
2780 |
+
* @see \Codeception\Module\WebDriver::waitForJS()
|
2781 |
+
*/
|
2782 |
+
public function waitForJS($script, $timeout = null) {
|
2783 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForJS', func_get_args()));
|
2784 |
+
}
|
2785 |
+
|
2786 |
+
|
2787 |
+
/**
|
2788 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2789 |
+
*
|
2790 |
+
* Executes custom JavaScript.
|
2791 |
+
*
|
2792 |
+
* This example uses jQuery to get a value and assigns that value to a PHP variable:
|
2793 |
+
*
|
2794 |
+
* ```php
|
2795 |
+
* <?php
|
2796 |
+
* $myVar = $I->executeJS('return $("#myField").val()');
|
2797 |
+
*
|
2798 |
+
* // additional arguments can be passed as array
|
2799 |
+
* // Example shows `Hello World` alert:
|
2800 |
+
* $I->executeJS("window.alert(arguments[0])", ['Hello world']);
|
2801 |
+
* ```
|
2802 |
+
*
|
2803 |
+
* @param $script
|
2804 |
+
* @param array $arguments
|
2805 |
+
* @return mixed
|
2806 |
+
* @see \Codeception\Module\WebDriver::executeJS()
|
2807 |
+
*/
|
2808 |
+
public function executeJS($script, $arguments = null) {
|
2809 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('executeJS', func_get_args()));
|
2810 |
+
}
|
2811 |
+
|
2812 |
+
|
2813 |
+
/**
|
2814 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2815 |
+
*
|
2816 |
+
* Executes asynchronous JavaScript.
|
2817 |
+
* A callback should be executed by JavaScript to exit from a script.
|
2818 |
+
* Callback is passed as a last element in `arguments` array.
|
2819 |
+
* Additional arguments can be passed as array in second parameter.
|
2820 |
+
*
|
2821 |
+
* ```js
|
2822 |
+
* // wait for 1200 milliseconds my running `setTimeout`
|
2823 |
+
* * $I->executeAsyncJS('setTimeout(arguments[0], 1200)');
|
2824 |
+
*
|
2825 |
+
* $seconds = 1200; // or seconds are passed as argument
|
2826 |
+
* $I->executeAsyncJS('setTimeout(arguments[1], arguments[0])', [$seconds]);
|
2827 |
+
* ```
|
2828 |
+
*
|
2829 |
+
* @param $script
|
2830 |
+
* @param array $arguments
|
2831 |
+
* @return mixed
|
2832 |
+
* @see \Codeception\Module\WebDriver::executeAsyncJS()
|
2833 |
+
*/
|
2834 |
+
public function executeAsyncJS($script, $arguments = null) {
|
2835 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('executeAsyncJS', func_get_args()));
|
2836 |
+
}
|
2837 |
+
|
2838 |
+
|
2839 |
+
/**
|
2840 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2841 |
+
*
|
2842 |
+
* Maximizes the current window.
|
2843 |
+
* @see \Codeception\Module\WebDriver::maximizeWindow()
|
2844 |
+
*/
|
2845 |
+
public function maximizeWindow() {
|
2846 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('maximizeWindow', func_get_args()));
|
2847 |
+
}
|
2848 |
+
|
2849 |
+
|
2850 |
+
/**
|
2851 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2852 |
+
*
|
2853 |
+
* Performs a simple mouse drag-and-drop operation.
|
2854 |
+
*
|
2855 |
+
* ``` php
|
2856 |
+
* <?php
|
2857 |
+
* $I->dragAndDrop('#drag', '#drop');
|
2858 |
+
* ?>
|
2859 |
+
* ```
|
2860 |
+
*
|
2861 |
+
* @param string $source (CSS ID or XPath)
|
2862 |
+
* @param string $target (CSS ID or XPath)
|
2863 |
+
* @see \Codeception\Module\WebDriver::dragAndDrop()
|
2864 |
+
*/
|
2865 |
+
public function dragAndDrop($source, $target) {
|
2866 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dragAndDrop', func_get_args()));
|
2867 |
+
}
|
2868 |
+
|
2869 |
+
|
2870 |
+
/**
|
2871 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2872 |
+
*
|
2873 |
+
* Move mouse over the first element matched by the given locator.
|
2874 |
+
* If the first parameter null then the page is used.
|
2875 |
+
* If the second and third parameters are given,
|
2876 |
+
* then the mouse is moved to an offset of the element's top-left corner.
|
2877 |
+
* Otherwise, the mouse is moved to the center of the element.
|
2878 |
+
*
|
2879 |
+
* ``` php
|
2880 |
+
* <?php
|
2881 |
+
* $I->moveMouseOver(['css' => '.checkout']);
|
2882 |
+
* $I->moveMouseOver(null, 20, 50);
|
2883 |
+
* $I->moveMouseOver(['css' => '.checkout'], 20, 50);
|
2884 |
+
* ?>
|
2885 |
+
* ```
|
2886 |
+
*
|
2887 |
+
* @param string $cssOrXPath css or xpath of the web element
|
2888 |
+
* @param int $offsetX
|
2889 |
+
* @param int $offsetY
|
2890 |
+
*
|
2891 |
+
* @throws \Codeception\Exception\ElementNotFound
|
2892 |
+
* @see \Codeception\Module\WebDriver::moveMouseOver()
|
2893 |
+
*/
|
2894 |
+
public function moveMouseOver($cssOrXPath = null, $offsetX = null, $offsetY = null) {
|
2895 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('moveMouseOver', func_get_args()));
|
2896 |
+
}
|
2897 |
+
|
2898 |
+
|
2899 |
+
/**
|
2900 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2901 |
+
*
|
2902 |
+
* Performs click with the left mouse button on an element.
|
2903 |
+
* If the first parameter `null` then the offset is relative to the actual mouse position.
|
2904 |
+
* If the second and third parameters are given,
|
2905 |
+
* then the mouse is moved to an offset of the element's top-left corner.
|
2906 |
+
* Otherwise, the mouse is moved to the center of the element.
|
2907 |
+
*
|
2908 |
+
* ``` php
|
2909 |
+
* <?php
|
2910 |
+
* $I->clickWithLeftButton(['css' => '.checkout']);
|
2911 |
+
* $I->clickWithLeftButton(null, 20, 50);
|
2912 |
+
* $I->clickWithLeftButton(['css' => '.checkout'], 20, 50);
|
2913 |
+
* ?>
|
2914 |
+
* ```
|
2915 |
+
*
|
2916 |
+
* @param string $cssOrXPath css or xpath of the web element (body by default).
|
2917 |
+
* @param int $offsetX
|
2918 |
+
* @param int $offsetY
|
2919 |
+
*
|
2920 |
+
* @throws \Codeception\Exception\ElementNotFound
|
2921 |
+
* @see \Codeception\Module\WebDriver::clickWithLeftButton()
|
2922 |
+
*/
|
2923 |
+
public function clickWithLeftButton($cssOrXPath = null, $offsetX = null, $offsetY = null) {
|
2924 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('clickWithLeftButton', func_get_args()));
|
2925 |
+
}
|
2926 |
+
|
2927 |
+
|
2928 |
+
/**
|
2929 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2930 |
+
*
|
2931 |
+
* Performs contextual click with the right mouse button on an element.
|
2932 |
+
* If the first parameter `null` then the offset is relative to the actual mouse position.
|
2933 |
+
* If the second and third parameters are given,
|
2934 |
+
* then the mouse is moved to an offset of the element's top-left corner.
|
2935 |
+
* Otherwise, the mouse is moved to the center of the element.
|
2936 |
+
*
|
2937 |
+
* ``` php
|
2938 |
+
* <?php
|
2939 |
+
* $I->clickWithRightButton(['css' => '.checkout']);
|
2940 |
+
* $I->clickWithRightButton(null, 20, 50);
|
2941 |
+
* $I->clickWithRightButton(['css' => '.checkout'], 20, 50);
|
2942 |
+
* ?>
|
2943 |
+
* ```
|
2944 |
+
*
|
2945 |
+
* @param string $cssOrXPath css or xpath of the web element (body by default).
|
2946 |
+
* @param int $offsetX
|
2947 |
+
* @param int $offsetY
|
2948 |
+
*
|
2949 |
+
* @throws \Codeception\Exception\ElementNotFound
|
2950 |
+
* @see \Codeception\Module\WebDriver::clickWithRightButton()
|
2951 |
+
*/
|
2952 |
+
public function clickWithRightButton($cssOrXPath = null, $offsetX = null, $offsetY = null) {
|
2953 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('clickWithRightButton', func_get_args()));
|
2954 |
+
}
|
2955 |
+
|
2956 |
+
|
2957 |
+
/**
|
2958 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2959 |
+
*
|
2960 |
+
* Performs a double-click on an element matched by CSS or XPath.
|
2961 |
+
*
|
2962 |
+
* @param $cssOrXPath
|
2963 |
+
* @throws \Codeception\Exception\ElementNotFound
|
2964 |
+
* @see \Codeception\Module\WebDriver::doubleClick()
|
2965 |
+
*/
|
2966 |
+
public function doubleClick($cssOrXPath) {
|
2967 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('doubleClick', func_get_args()));
|
2968 |
+
}
|
2969 |
+
|
2970 |
+
|
2971 |
+
/**
|
2972 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
2973 |
+
*
|
2974 |
+
* Presses the given key on the given element.
|
2975 |
+
* To specify a character and modifier (e.g. ctrl, alt, shift, meta), pass an array for $char with
|
2976 |
+
* the modifier as the first element and the character as the second.
|
2977 |
+
* For special keys use key constants from WebDriverKeys class.
|
2978 |
+
*
|
2979 |
+
* ``` php
|
2980 |
+
* <?php
|
2981 |
+
* // <input id="page" value="old" />
|
2982 |
+
* $I->pressKey('#page','a'); // => olda
|
2983 |
+
* $I->pressKey('#page',array('ctrl','a'),'new'); //=> new
|
2984 |
+
* $I->pressKey('#page',array('shift','111'),'1','x'); //=> old!!!1x
|
2985 |
+
* $I->pressKey('descendant-or-self::*[@id='page']','u'); //=> oldu
|
2986 |
+
* $I->pressKey('#name', array('ctrl', 'a'), \Facebook\WebDriver\WebDriverKeys::DELETE); //=>''
|
2987 |
+
* ?>
|
2988 |
+
* ```
|
2989 |
+
*
|
2990 |
+
* @param $element
|
2991 |
+
* @param $char string|array Can be char or array with modifier. You can provide several chars.
|
2992 |
+
* @throws \Codeception\Exception\ElementNotFound
|
2993 |
+
* @see \Codeception\Module\WebDriver::pressKey()
|
2994 |
+
*/
|
2995 |
+
public function pressKey($element, $char) {
|
2996 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('pressKey', func_get_args()));
|
2997 |
+
}
|
2998 |
+
|
2999 |
+
|
3000 |
+
/**
|
3001 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3002 |
+
*
|
3003 |
+
* Append the given text to the given element.
|
3004 |
+
* Can also add a selection to a select box.
|
3005 |
+
*
|
3006 |
+
* ``` php
|
3007 |
+
* <?php
|
3008 |
+
* $I->appendField('#mySelectbox', 'SelectValue');
|
3009 |
+
* $I->appendField('#myTextField', 'appended');
|
3010 |
+
* ?>
|
3011 |
+
* ```
|
3012 |
+
*
|
3013 |
+
* @param string $field
|
3014 |
+
* @param string $value
|
3015 |
+
* @throws \Codeception\Exception\ElementNotFound
|
3016 |
+
* @see \Codeception\Module\WebDriver::appendField()
|
3017 |
+
*/
|
3018 |
+
public function appendField($field, $value) {
|
3019 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('appendField', func_get_args()));
|
3020 |
+
}
|
3021 |
+
|
3022 |
+
|
3023 |
+
/**
|
3024 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3025 |
+
*
|
3026 |
+
* Saves current cookies into named snapshot in order to restore them in other tests
|
3027 |
+
* This is useful to save session state between tests.
|
3028 |
+
* For example, if user needs log in to site for each test this scenario can be executed once
|
3029 |
+
* while other tests can just restore saved cookies.
|
3030 |
+
*
|
3031 |
+
* ``` php
|
3032 |
+
* <?php
|
3033 |
+
* // inside AcceptanceTester class:
|
3034 |
+
*
|
3035 |
+
* public function login()
|
3036 |
+
* {
|
3037 |
+
* // if snapshot exists - skipping login
|
3038 |
+
* if ($I->loadSessionSnapshot('login')) return;
|
3039 |
+
*
|
3040 |
+
* // logging in
|
3041 |
+
* $I->amOnPage('/login');
|
3042 |
+
* $I->fillField('name', 'jon');
|
3043 |
+
* $I->fillField('password', '123345');
|
3044 |
+
* $I->click('Login');
|
3045 |
+
*
|
3046 |
+
* // saving snapshot
|
3047 |
+
* $I->saveSessionSnapshot('login');
|
3048 |
+
* }
|
3049 |
+
* ?>
|
3050 |
+
* ```
|
3051 |
+
*
|
3052 |
+
* @param $name
|
3053 |
+
* @return mixed
|
3054 |
+
* @see \Codeception\Module\WebDriver::saveSessionSnapshot()
|
3055 |
+
*/
|
3056 |
+
public function saveSessionSnapshot($name) {
|
3057 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('saveSessionSnapshot', func_get_args()));
|
3058 |
+
}
|
3059 |
+
|
3060 |
+
|
3061 |
+
/**
|
3062 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3063 |
+
*
|
3064 |
+
* Loads cookies from a saved snapshot.
|
3065 |
+
* Allows to reuse same session across tests without additional login.
|
3066 |
+
*
|
3067 |
+
* See [saveSessionSnapshot](#saveSessionSnapshot)
|
3068 |
+
*
|
3069 |
+
* @param $name
|
3070 |
+
* @return mixed
|
3071 |
+
* @see \Codeception\Module\WebDriver::loadSessionSnapshot()
|
3072 |
+
*/
|
3073 |
+
public function loadSessionSnapshot($name) {
|
3074 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('loadSessionSnapshot', func_get_args()));
|
3075 |
+
}
|
3076 |
+
|
3077 |
+
|
3078 |
+
/**
|
3079 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3080 |
+
*
|
3081 |
+
* Deletes session snapshot.
|
3082 |
+
*
|
3083 |
+
* See [saveSessionSnapshot](#saveSessionSnapshot)
|
3084 |
+
*
|
3085 |
+
* @param $name
|
3086 |
+
* @return mixed
|
3087 |
+
* @see \Codeception\Module\WebDriver::deleteSessionSnapshot()
|
3088 |
+
*/
|
3089 |
+
public function deleteSessionSnapshot($name) {
|
3090 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteSessionSnapshot', func_get_args()));
|
3091 |
+
}
|
3092 |
+
|
3093 |
+
|
3094 |
+
/**
|
3095 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3096 |
+
*
|
3097 |
+
* Move to the middle of the given element matched by the given locator.
|
3098 |
+
* Extra shift, calculated from the top-left corner of the element,
|
3099 |
+
* can be set by passing $offsetX and $offsetY parameters.
|
3100 |
+
*
|
3101 |
+
* ``` php
|
3102 |
+
* <?php
|
3103 |
+
* $I->scrollTo(['css' => '.checkout'], 20, 50);
|
3104 |
+
* ?>
|
3105 |
+
* ```
|
3106 |
+
*
|
3107 |
+
* @param $selector
|
3108 |
+
* @param int $offsetX
|
3109 |
+
* @param int $offsetY
|
3110 |
+
* @see \Codeception\Module\WebDriver::scrollTo()
|
3111 |
+
*/
|
3112 |
+
public function scrollTo($selector, $offsetX = null, $offsetY = null) {
|
3113 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('scrollTo', func_get_args()));
|
3114 |
+
}
|
3115 |
+
|
3116 |
+
|
3117 |
+
/**
|
3118 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3119 |
+
*
|
3120 |
+
* Opens a new browser tab (wherever it is possible) and switches to it.
|
3121 |
+
*
|
3122 |
+
* ```php
|
3123 |
+
* <?php
|
3124 |
+
* $I->openNewTab();
|
3125 |
+
* ```
|
3126 |
+
* Tab is opened by using `window.open` javascript in a browser.
|
3127 |
+
* Please note, that adblock can restrict creating such tabs.
|
3128 |
+
*
|
3129 |
+
* Can't be used with PhantomJS
|
3130 |
+
*
|
3131 |
+
* @see \Codeception\Module\WebDriver::openNewTab()
|
3132 |
+
*/
|
3133 |
+
public function openNewTab() {
|
3134 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('openNewTab', func_get_args()));
|
3135 |
+
}
|
3136 |
+
|
3137 |
+
|
3138 |
+
/**
|
3139 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3140 |
+
*
|
3141 |
+
* Closes current browser tab and switches to previous active tab.
|
3142 |
+
*
|
3143 |
+
* ```php
|
3144 |
+
* <?php
|
3145 |
+
* $I->closeTab();
|
3146 |
+
* ```
|
3147 |
+
*
|
3148 |
+
* Can't be used with PhantomJS
|
3149 |
+
* @see \Codeception\Module\WebDriver::closeTab()
|
3150 |
+
*/
|
3151 |
+
public function closeTab() {
|
3152 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('closeTab', func_get_args()));
|
3153 |
+
}
|
3154 |
+
|
3155 |
+
|
3156 |
+
/**
|
3157 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3158 |
+
*
|
3159 |
+
* Switches to next browser tab.
|
3160 |
+
* An offset can be specified.
|
3161 |
+
*
|
3162 |
+
* ```php
|
3163 |
+
* <?php
|
3164 |
+
* // switch to next tab
|
3165 |
+
* $I->switchToNextTab();
|
3166 |
+
* // switch to 2nd next tab
|
3167 |
+
* $I->switchToNextTab(2);
|
3168 |
+
* ```
|
3169 |
+
*
|
3170 |
+
* Can't be used with PhantomJS
|
3171 |
+
*
|
3172 |
+
* @param int $offset 1
|
3173 |
+
* @see \Codeception\Module\WebDriver::switchToNextTab()
|
3174 |
+
*/
|
3175 |
+
public function switchToNextTab($offset = null) {
|
3176 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToNextTab', func_get_args()));
|
3177 |
+
}
|
3178 |
+
|
3179 |
+
|
3180 |
+
/**
|
3181 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3182 |
+
*
|
3183 |
+
* Switches to previous browser tab.
|
3184 |
+
* An offset can be specified.
|
3185 |
+
*
|
3186 |
+
* ```php
|
3187 |
+
* <?php
|
3188 |
+
* // switch to previous tab
|
3189 |
+
* $I->switchToPreviousTab();
|
3190 |
+
* // switch to 2nd previous tab
|
3191 |
+
* $I->switchToPreviousTab(2);
|
3192 |
+
* ```
|
3193 |
+
*
|
3194 |
+
* Can't be used with PhantomJS
|
3195 |
+
*
|
3196 |
+
* @param int $offset 1
|
3197 |
+
* @see \Codeception\Module\WebDriver::switchToPreviousTab()
|
3198 |
+
*/
|
3199 |
+
public function switchToPreviousTab($offset = null) {
|
3200 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToPreviousTab', func_get_args()));
|
3201 |
+
}
|
3202 |
+
|
3203 |
+
|
3204 |
+
/**
|
3205 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3206 |
+
*
|
3207 |
+
* Waits for element and runs a sequence of actions inside its context.
|
3208 |
+
* Actions can be defined with array, callback, or `Codeception\Util\ActionSequence` instance.
|
3209 |
+
*
|
3210 |
+
* Actions as array are recommended for simple to combine "waitForElement" with assertions;
|
3211 |
+
* `waitForElement($el)` and `see('text', $el)` can be simplified to:
|
3212 |
+
*
|
3213 |
+
* ```php
|
3214 |
+
* <?php
|
3215 |
+
* $I->performOn($el, ['see' => 'text']);
|
3216 |
+
* ```
|
3217 |
+
*
|
3218 |
+
* List of actions can be pragmatically build using `Codeception\Util\ActionSequence`:
|
3219 |
+
*
|
3220 |
+
* ```php
|
3221 |
+
* <?php
|
3222 |
+
* $I->performOn('.model', ActionSequence::build()
|
3223 |
+
* ->see('Warning')
|
3224 |
+
* ->see('Are you sure you want to delete this?')
|
3225 |
+
* ->click('Yes')
|
3226 |
+
* );
|
3227 |
+
* ```
|
3228 |
+
*
|
3229 |
+
* Actions executed from array or ActionSequence will print debug output for actions, and adds an action name to
|
3230 |
+
* exception on failure.
|
3231 |
+
*
|
3232 |
+
* Whenever you need to define more actions a callback can be used. A WebDriver module is passed for argument:
|
3233 |
+
*
|
3234 |
+
* ```php
|
3235 |
+
* <?php
|
3236 |
+
* $I->performOn('.rememberMe', function (WebDriver $I) {
|
3237 |
+
* $I->see('Remember me next time');
|
3238 |
+
* $I->seeElement('#LoginForm_rememberMe');
|
3239 |
+
* $I->dontSee('Login');
|
3240 |
+
* });
|
3241 |
+
* ```
|
3242 |
+
*
|
3243 |
+
* In 3rd argument you can set number a seconds to wait for element to appear
|
3244 |
+
*
|
3245 |
+
* @param $element
|
3246 |
+
* @param $actions
|
3247 |
+
* @param int $timeout
|
3248 |
+
* @see \Codeception\Module\WebDriver::performOn()
|
3249 |
+
*/
|
3250 |
+
public function performOn($element, $actions, $timeout = null) {
|
3251 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('performOn', func_get_args()));
|
3252 |
+
}
|
3253 |
+
|
3254 |
+
|
3255 |
+
/**
|
3256 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3257 |
+
*
|
3258 |
+
* Go to the plugins administration screen.
|
3259 |
+
*
|
3260 |
+
* The method will **not** handle authentication.
|
3261 |
+
*
|
3262 |
+
* @example
|
3263 |
+
* ```php
|
3264 |
+
* $I->loginAsAdmin();
|
3265 |
+
* $I->amOnPluginsPage();
|
3266 |
+
* $I->activatePlugin('hello-dolly');
|
3267 |
+
* ```
|
3268 |
+
* @see \Codeception\Module\WPWebDriver::amOnPluginsPage()
|
3269 |
+
*/
|
3270 |
+
public function amOnPluginsPage() {
|
3271 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPluginsPage', func_get_args()));
|
3272 |
+
}
|
3273 |
+
|
3274 |
+
|
3275 |
+
/**
|
3276 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3277 |
+
*
|
3278 |
+
* Go the "Pages" administration screen.
|
3279 |
+
*
|
3280 |
+
* The method will **not** handle authentication.
|
3281 |
+
*
|
3282 |
+
* @example
|
3283 |
+
* ```php
|
3284 |
+
* $I->loginAsAdmin();
|
3285 |
+
* $I->amOnPagesPage();
|
3286 |
+
* $I->see('Add New');
|
3287 |
+
* ```
|
3288 |
+
* @see \Codeception\Module\WPWebDriver::amOnPagesPage()
|
3289 |
+
*/
|
3290 |
+
public function amOnPagesPage() {
|
3291 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPagesPage', func_get_args()));
|
3292 |
+
}
|
3293 |
+
|
3294 |
+
|
3295 |
+
/**
|
3296 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3297 |
+
*
|
3298 |
+
* Assert a plugin is not activated in the plugins administration screen.
|
3299 |
+
*
|
3300 |
+
* The method will **not** handle authentication and navigation to the plugin administration screen.
|
3301 |
+
*
|
3302 |
+
* @example
|
3303 |
+
* ```php
|
3304 |
+
* $I->loginAsAdmin();
|
3305 |
+
* $I->amOnPluginsPage();
|
3306 |
+
* $I->seePluginDeactivated('my-plugin');
|
3307 |
+
* ```
|
3308 |
+
*
|
3309 |
+
* @param string $pluginSlug The plugin slug, like "hello-dolly".
|
3310 |
+
* @see \Codeception\Module\WPWebDriver::seePluginDeactivated()
|
3311 |
+
*/
|
3312 |
+
public function seePluginDeactivated($pluginSlug) {
|
3313 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePluginDeactivated', func_get_args()));
|
3314 |
+
}
|
3315 |
+
/**
|
3316 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3317 |
+
*
|
3318 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
3319 |
+
* Assert a plugin is not activated in the plugins administration screen.
|
3320 |
+
*
|
3321 |
+
* The method will **not** handle authentication and navigation to the plugin administration screen.
|
3322 |
+
*
|
3323 |
+
* @example
|
3324 |
+
* ```php
|
3325 |
+
* $I->loginAsAdmin();
|
3326 |
+
* $I->amOnPluginsPage();
|
3327 |
+
* $I->seePluginDeactivated('my-plugin');
|
3328 |
+
* ```
|
3329 |
+
*
|
3330 |
+
* @param string $pluginSlug The plugin slug, like "hello-dolly".
|
3331 |
+
* @see \Codeception\Module\WPWebDriver::seePluginDeactivated()
|
3332 |
+
*/
|
3333 |
+
public function canSeePluginDeactivated($pluginSlug) {
|
3334 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePluginDeactivated', func_get_args()));
|
3335 |
+
}
|
3336 |
+
|
3337 |
+
|
3338 |
+
/**
|
3339 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3340 |
+
*
|
3341 |
+
* Assert a plugin is installed, no matter its activation status, in the plugin adminstration screen.
|
3342 |
+
*
|
3343 |
+
* The method will **not** handle authentication and navigation to the plugin administration screen.
|
3344 |
+
*
|
3345 |
+
* @example
|
3346 |
+
* ```php
|
3347 |
+
* $I->loginAsAdmin();
|
3348 |
+
* $I->amOnPluginsPage();
|
3349 |
+
* $I->seePluginInstalled('my-plugin');
|
3350 |
+
* ```
|
3351 |
+
*
|
3352 |
+
* @param string $pluginSlug The plugin slug, like "hello-dolly".
|
3353 |
+
* @see \Codeception\Module\WPWebDriver::seePluginInstalled()
|
3354 |
+
*/
|
3355 |
+
public function seePluginInstalled($pluginSlug) {
|
3356 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePluginInstalled', func_get_args()));
|
3357 |
+
}
|
3358 |
+
/**
|
3359 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3360 |
+
*
|
3361 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
3362 |
+
* Assert a plugin is installed, no matter its activation status, in the plugin adminstration screen.
|
3363 |
+
*
|
3364 |
+
* The method will **not** handle authentication and navigation to the plugin administration screen.
|
3365 |
+
*
|
3366 |
+
* @example
|
3367 |
+
* ```php
|
3368 |
+
* $I->loginAsAdmin();
|
3369 |
+
* $I->amOnPluginsPage();
|
3370 |
+
* $I->seePluginInstalled('my-plugin');
|
3371 |
+
* ```
|
3372 |
+
*
|
3373 |
+
* @param string $pluginSlug The plugin slug, like "hello-dolly".
|
3374 |
+
* @see \Codeception\Module\WPWebDriver::seePluginInstalled()
|
3375 |
+
*/
|
3376 |
+
public function canSeePluginInstalled($pluginSlug) {
|
3377 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePluginInstalled', func_get_args()));
|
3378 |
+
}
|
3379 |
+
|
3380 |
+
|
3381 |
+
/**
|
3382 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3383 |
+
*
|
3384 |
+
* Assert a plugin is activated in the plugin administration screen.
|
3385 |
+
*
|
3386 |
+
* The method will **not** handle authentication and navigation to the plugin administration screen.
|
3387 |
+
*
|
3388 |
+
* @example
|
3389 |
+
* ```php
|
3390 |
+
* $I->loginAsAdmin();
|
3391 |
+
* $I->amOnPluginsPage();
|
3392 |
+
* $I->seePluginActivated('my-plugin');
|
3393 |
+
* ```
|
3394 |
+
*
|
3395 |
+
* @param string $pluginSlug The plugin slug, like "hello-dolly".
|
3396 |
+
* @see \Codeception\Module\WPWebDriver::seePluginActivated()
|
3397 |
+
*/
|
3398 |
+
public function seePluginActivated($pluginSlug) {
|
3399 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePluginActivated', func_get_args()));
|
3400 |
+
}
|
3401 |
+
/**
|
3402 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3403 |
+
*
|
3404 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
3405 |
+
* Assert a plugin is activated in the plugin administration screen.
|
3406 |
+
*
|
3407 |
+
* The method will **not** handle authentication and navigation to the plugin administration screen.
|
3408 |
+
*
|
3409 |
+
* @example
|
3410 |
+
* ```php
|
3411 |
+
* $I->loginAsAdmin();
|
3412 |
+
* $I->amOnPluginsPage();
|
3413 |
+
* $I->seePluginActivated('my-plugin');
|
3414 |
+
* ```
|
3415 |
+
*
|
3416 |
+
* @param string $pluginSlug The plugin slug, like "hello-dolly".
|
3417 |
+
* @see \Codeception\Module\WPWebDriver::seePluginActivated()
|
3418 |
+
*/
|
3419 |
+
public function canSeePluginActivated($pluginSlug) {
|
3420 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePluginActivated', func_get_args()));
|
3421 |
+
}
|
3422 |
+
|
3423 |
+
|
3424 |
+
/**
|
3425 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3426 |
+
*
|
3427 |
+
* Assert a plugin is not installed in the plugins administration screen.
|
3428 |
+
*
|
3429 |
+
* The method will **not** handle authentication and navigation to the plugin administration screen.
|
3430 |
+
*
|
3431 |
+
* @example
|
3432 |
+
* ```php
|
3433 |
+
* $I->loginAsAdmin();
|
3434 |
+
* $I->amOnPluginsPage();
|
3435 |
+
* $I->dontSeePluginInstalled('my-plugin');
|
3436 |
+
* ```
|
3437 |
+
*
|
3438 |
+
* @param string $pluginSlug The plugin slug, like "hello-dolly".
|
3439 |
+
* @see \Codeception\Module\WPWebDriver::dontSeePluginInstalled()
|
3440 |
+
*/
|
3441 |
+
public function dontSeePluginInstalled($pluginSlug) {
|
3442 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeePluginInstalled', func_get_args()));
|
3443 |
+
}
|
3444 |
+
/**
|
3445 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3446 |
+
*
|
3447 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
3448 |
+
* Assert a plugin is not installed in the plugins administration screen.
|
3449 |
+
*
|
3450 |
+
* The method will **not** handle authentication and navigation to the plugin administration screen.
|
3451 |
+
*
|
3452 |
+
* @example
|
3453 |
+
* ```php
|
3454 |
+
* $I->loginAsAdmin();
|
3455 |
+
* $I->amOnPluginsPage();
|
3456 |
+
* $I->dontSeePluginInstalled('my-plugin');
|
3457 |
+
* ```
|
3458 |
+
*
|
3459 |
+
* @param string $pluginSlug The plugin slug, like "hello-dolly".
|
3460 |
+
* @see \Codeception\Module\WPWebDriver::dontSeePluginInstalled()
|
3461 |
+
*/
|
3462 |
+
public function cantSeePluginInstalled($pluginSlug) {
|
3463 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeePluginInstalled', func_get_args()));
|
3464 |
+
}
|
3465 |
+
|
3466 |
+
|
3467 |
+
/**
|
3468 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3469 |
+
*
|
3470 |
+
* In an administration screen look for an error admin notice.
|
3471 |
+
*
|
3472 |
+
* The check is class-based to decouple from internationalization.
|
3473 |
+
* The method will **not** handle authentication and navigation the administration area.
|
3474 |
+
*
|
3475 |
+
* @example
|
3476 |
+
* ```php
|
3477 |
+
* $I->loginAsAdmin()ja
|
3478 |
+
* $I->amOnAdminPage('/');
|
3479 |
+
* $I->seeErrorMessage('.my-plugin');
|
3480 |
+
* ```
|
3481 |
+
*
|
3482 |
+
* @param array|string $classes A list of classes the notice should have other than the `.notice.notice-error` ones.
|
3483 |
+
* @see \Codeception\Module\WPWebDriver::seeErrorMessage()
|
3484 |
+
*/
|
3485 |
+
public function seeErrorMessage($classes = null) {
|
3486 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeErrorMessage', func_get_args()));
|
3487 |
+
}
|
3488 |
+
/**
|
3489 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3490 |
+
*
|
3491 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
3492 |
+
* In an administration screen look for an error admin notice.
|
3493 |
+
*
|
3494 |
+
* The check is class-based to decouple from internationalization.
|
3495 |
+
* The method will **not** handle authentication and navigation the administration area.
|
3496 |
+
*
|
3497 |
+
* @example
|
3498 |
+
* ```php
|
3499 |
+
* $I->loginAsAdmin()ja
|
3500 |
+
* $I->amOnAdminPage('/');
|
3501 |
+
* $I->seeErrorMessage('.my-plugin');
|
3502 |
+
* ```
|
3503 |
+
*
|
3504 |
+
* @param array|string $classes A list of classes the notice should have other than the `.notice.notice-error` ones.
|
3505 |
+
* @see \Codeception\Module\WPWebDriver::seeErrorMessage()
|
3506 |
+
*/
|
3507 |
+
public function canSeeErrorMessage($classes = null) {
|
3508 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeErrorMessage', func_get_args()));
|
3509 |
+
}
|
3510 |
+
|
3511 |
+
|
3512 |
+
/**
|
3513 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3514 |
+
*
|
3515 |
+
* Checks that the current page is one generated by the `wp_die` function.
|
3516 |
+
*
|
3517 |
+
* The method will try to identify the page based on the default WordPress die page HTML attributes.
|
3518 |
+
*
|
3519 |
+
* @example
|
3520 |
+
* ```php
|
3521 |
+
* $I->loginAs('user', 'password');
|
3522 |
+
* $I->amOnAdminPage('/forbidden');
|
3523 |
+
* $I->seeWpDiePage();
|
3524 |
+
* ```
|
3525 |
+
* @see \Codeception\Module\WPWebDriver::seeWpDiePage()
|
3526 |
+
*/
|
3527 |
+
public function seeWpDiePage() {
|
3528 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeWpDiePage', func_get_args()));
|
3529 |
+
}
|
3530 |
+
/**
|
3531 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3532 |
+
*
|
3533 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
3534 |
+
* Checks that the current page is one generated by the `wp_die` function.
|
3535 |
+
*
|
3536 |
+
* The method will try to identify the page based on the default WordPress die page HTML attributes.
|
3537 |
+
*
|
3538 |
+
* @example
|
3539 |
+
* ```php
|
3540 |
+
* $I->loginAs('user', 'password');
|
3541 |
+
* $I->amOnAdminPage('/forbidden');
|
3542 |
+
* $I->seeWpDiePage();
|
3543 |
+
* ```
|
3544 |
+
* @see \Codeception\Module\WPWebDriver::seeWpDiePage()
|
3545 |
+
*/
|
3546 |
+
public function canSeeWpDiePage() {
|
3547 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeWpDiePage', func_get_args()));
|
3548 |
+
}
|
3549 |
+
|
3550 |
+
|
3551 |
+
/**
|
3552 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3553 |
+
*
|
3554 |
+
* In an administration screen look for an admin notice.
|
3555 |
+
*
|
3556 |
+
* The check is class-based to decouple from internationalization.
|
3557 |
+
* The method will **not** handle authentication and navigation the administration area.
|
3558 |
+
*
|
3559 |
+
* @example
|
3560 |
+
* ```php
|
3561 |
+
* $I->loginAsAdmin()ja
|
3562 |
+
* $I->amOnAdminPage('/');
|
3563 |
+
* $I->seeMessage('.missing-api-token.my-plugin');
|
3564 |
+
* ```
|
3565 |
+
*
|
3566 |
+
* @param array|string $classes A list of classes the message should have in addition to the `.notice` one.
|
3567 |
+
* @see \Codeception\Module\WPWebDriver::seeMessage()
|
3568 |
+
*/
|
3569 |
+
public function seeMessage($classes = null) {
|
3570 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeMessage', func_get_args()));
|
3571 |
+
}
|
3572 |
+
/**
|
3573 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3574 |
+
*
|
3575 |
+
* [!] Conditional Assertion: Test won't be stopped on fail
|
3576 |
+
* In an administration screen look for an admin notice.
|
3577 |
+
*
|
3578 |
+
* The check is class-based to decouple from internationalization.
|
3579 |
+
* The method will **not** handle authentication and navigation the administration area.
|
3580 |
+
*
|
3581 |
+
* @example
|
3582 |
+
* ```php
|
3583 |
+
* $I->loginAsAdmin()ja
|
3584 |
+
* $I->amOnAdminPage('/');
|
3585 |
+
* $I->seeMessage('.missing-api-token.my-plugin');
|
3586 |
+
* ```
|
3587 |
+
*
|
3588 |
+
* @param array|string $classes A list of classes the message should have in addition to the `.notice` one.
|
3589 |
+
* @see \Codeception\Module\WPWebDriver::seeMessage()
|
3590 |
+
*/
|
3591 |
+
public function canSeeMessage($classes = null) {
|
3592 |
+
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeMessage', func_get_args()));
|
3593 |
+
}
|
3594 |
+
|
3595 |
+
|
3596 |
+
/**
|
3597 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3598 |
+
*
|
3599 |
+
* Returns WordPress default test cookie object if present.
|
3600 |
+
* @example
|
3601 |
+
* ```php
|
3602 |
+
* // Grab the default WordPress test cookie.
|
3603 |
+
* $wpTestCookie = $I->grabWordPressTestCookie();
|
3604 |
+
* // Grab a customized version of the test cookie.
|
3605 |
+
* $myTestCookie = $I->grabWordPressTestCookie('my_test_cookie');
|
3606 |
+
* ```
|
3607 |
+
*
|
3608 |
+
*
|
3609 |
+
* @param string $name Optional, overrides the default cookie name.
|
3610 |
+
*
|
3611 |
+
* @return mixed Either a cookie object or `null`.
|
3612 |
+
* @see \Codeception\Module\WPWebDriver::grabWordPressTestCookie()
|
3613 |
+
*/
|
3614 |
+
public function grabWordPressTestCookie($name = null) {
|
3615 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabWordPressTestCookie', func_get_args()));
|
3616 |
+
}
|
3617 |
+
|
3618 |
+
|
3619 |
+
/**
|
3620 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3621 |
+
*
|
3622 |
+
* Go to a page in the admininstration area of the site.
|
3623 |
+
*
|
3624 |
+
* This method will **not** handle authentication to the administration area.
|
3625 |
+
*
|
3626 |
+
* @example
|
3627 |
+
*
|
3628 |
+
* ```php
|
3629 |
+
* $I->loginAs('user', 'password');
|
3630 |
+
* // Go to the plugins management screen.
|
3631 |
+
* $I->amOnAdminPage('/plugins.php');
|
3632 |
+
* ```
|
3633 |
+
*
|
3634 |
+
* @param string $page The path, relative to the admin area URL, to the page.
|
3635 |
+
* @see \Codeception\Module\WPWebDriver::amOnAdminPage()
|
3636 |
+
*/
|
3637 |
+
public function amOnAdminPage($page) {
|
3638 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnAdminPage', func_get_args()));
|
3639 |
+
}
|
3640 |
+
|
3641 |
+
|
3642 |
+
/**
|
3643 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3644 |
+
*
|
3645 |
+
* Go to the `admin-ajax.php` page to start a synchronous, and blocking, `GET` AJAX request.
|
3646 |
+
*
|
3647 |
+
* The method will **not** handle authentication, nonces or authorization.
|
3648 |
+
*
|
3649 |
+
* @example
|
3650 |
+
* ```php
|
3651 |
+
* $I->amOnAdminAjaxPage(['action' => 'my-action', 'data' => ['id' => 23], 'nonce' => $nonce]);
|
3652 |
+
* ```
|
3653 |
+
*
|
3654 |
+
* @param array|string $queryVars A string or array of query variables to append to the AJAX path.
|
3655 |
+
* @see \Codeception\Module\WPWebDriver::amOnAdminAjaxPage()
|
3656 |
+
*/
|
3657 |
+
public function amOnAdminAjaxPage($queryVars = null) {
|
3658 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnAdminAjaxPage', func_get_args()));
|
3659 |
+
}
|
3660 |
+
|
3661 |
+
|
3662 |
+
/**
|
3663 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3664 |
+
*
|
3665 |
+
* Go to the cron page to start a synchronous, and blocking, `GET` request to the cron script.
|
3666 |
+
*
|
3667 |
+
* @example
|
3668 |
+
* ```php
|
3669 |
+
* // Triggers the cron job with an optional query argument.
|
3670 |
+
* $I->amOnCronPage('/?some-query-var=some-value');
|
3671 |
+
* ```
|
3672 |
+
*
|
3673 |
+
* @param array|string $queryVars A string or array of query variables to append to the AJAX path.
|
3674 |
+
* @see \Codeception\Module\WPWebDriver::amOnCronPage()
|
3675 |
+
*/
|
3676 |
+
public function amOnCronPage($queryVars = null) {
|
3677 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnCronPage', func_get_args()));
|
3678 |
+
}
|
3679 |
+
|
3680 |
+
|
3681 |
+
/**
|
3682 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
3683 |
+
*
|
3684 |
+
* Go to the admin page to edit the post with the specified ID.
|
3685 |
+
*
|
3686 |
+
* The method will **not** handle authentication the admin area.
|
3687 |
+
*
|
3688 |
+
* @example
|
3689 |
+
* ```php
|
3690 |
+
* $I->loginAsAdmin();
|
3691 |
+
* $postId = $I->havePostInDatabase();
|
3692 |
+
* $I->amEditingPostWithId($postId);
|
3693 |
+
* $I->fillField('post_title', 'Post title');
|
3694 |
+
* ```
|
3695 |
+
*
|
3696 |
+
* @param int $id The post ID.
|
3697 |
+
* @see \Codeception\Module\WPWebDriver::amEditingPostWithId()
|
3698 |
+
*/
|
3699 |
+
public function amEditingPostWithId($id) {
|
3700 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amEditingPostWithId', func_get_args()));
|
3701 |
+
}
|
3702 |
+
}
|
@@ -0,0 +1,963 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //[STAMP] fd83742a072ac1792b41155a99835659
|
2 |
+
namespace _generated;
|
3 |
+
|
4 |
+
// This class was automatically generated by build task
|
5 |
+
// You should not change it manually as it will be overwritten on next build
|
6 |
+
// @codingStandardsIgnoreFile
|
7 |
+
|
8 |
+
trait FunctionalTesterActions
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* @return \Codeception\Scenario
|
12 |
+
*/
|
13 |
+
abstract protected function getScenario();
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
18 |
+
*
|
19 |
+
* Handles and checks exception called inside callback function.
|
20 |
+
* Either exception class name or exception instance should be provided.
|
21 |
+
*
|
22 |
+
* ```php
|
23 |
+
* <?php
|
24 |
+
* $I->expectException(MyException::class, function() {
|
25 |
+
* $this->doSomethingBad();
|
26 |
+
* });
|
27 |
+
*
|
28 |
+
* $I->expectException(new MyException(), function() {
|
29 |
+
* $this->doSomethingBad();
|
30 |
+
* });
|
31 |
+
* ```
|
32 |
+
* If you want to check message or exception code, you can pass them with exception instance:
|
33 |
+
* ```php
|
34 |
+
* <?php
|
35 |
+
* // will check that exception MyException is thrown with "Don't do bad things" message
|
36 |
+
* $I->expectException(new MyException("Don't do bad things"), function() {
|
37 |
+
* $this->doSomethingBad();
|
38 |
+
* });
|
39 |
+
* ```
|
40 |
+
*
|
41 |
+
* @deprecated Use expectThrowable() instead
|
42 |
+
* @param $exception string or \Exception
|
43 |
+
* @param $callback
|
44 |
+
* @see \Codeception\Module\Asserts::expectException()
|
45 |
+
*/
|
46 |
+
public function expectException($exception, $callback) {
|
47 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args()));
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
/**
|
52 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
53 |
+
*
|
54 |
+
* Handles and checks throwables (Exceptions/Errors) called inside the callback function.
|
55 |
+
* Either throwable class name or throwable instance should be provided.
|
56 |
+
*
|
57 |
+
* ```php
|
58 |
+
* <?php
|
59 |
+
* $I->expectThrowable(MyThrowable::class, function() {
|
60 |
+
* $this->doSomethingBad();
|
61 |
+
* });
|
62 |
+
*
|
63 |
+
* $I->expectThrowable(new MyException(), function() {
|
64 |
+
* $this->doSomethingBad();
|
65 |
+
* });
|
66 |
+
* ```
|
67 |
+
* If you want to check message or throwable code, you can pass them with throwable instance:
|
68 |
+
* ```php
|
69 |
+
* <?php
|
70 |
+
* // will check that throwable MyError is thrown with "Don't do bad things" message
|
71 |
+
* $I->expectThrowable(new MyError("Don't do bad things"), function() {
|
72 |
+
* $this->doSomethingBad();
|
73 |
+
* });
|
74 |
+
* ```
|
75 |
+
*
|
76 |
+
* @param $throwable string or \Throwable
|
77 |
+
* @param $callback
|
78 |
+
* @see \Codeception\Module\Asserts::expectThrowable()
|
79 |
+
*/
|
80 |
+
public function expectThrowable($throwable, $callback) {
|
81 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectThrowable', func_get_args()));
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
/**
|
86 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
87 |
+
*
|
88 |
+
* Checks that two variables are equal.
|
89 |
+
*
|
90 |
+
* @param $expected
|
91 |
+
* @param $actual
|
92 |
+
* @param string $message
|
93 |
+
* @param float $delta
|
94 |
+
* @see \Codeception\Module\Asserts::assertEquals()
|
95 |
+
*/
|
96 |
+
public function assertEquals($expected, $actual, $message = null, $delta = null) {
|
97 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
103 |
+
*
|
104 |
+
* Checks that two variables are not equal
|
105 |
+
*
|
106 |
+
* @param $expected
|
107 |
+
* @param $actual
|
108 |
+
* @param string $message
|
109 |
+
* @param float $delta
|
110 |
+
* @see \Codeception\Module\Asserts::assertNotEquals()
|
111 |
+
*/
|
112 |
+
public function assertNotEquals($expected, $actual, $message = null, $delta = null) {
|
113 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
119 |
+
*
|
120 |
+
* Checks that two variables are same
|
121 |
+
*
|
122 |
+
* @param $expected
|
123 |
+
* @param $actual
|
124 |
+
* @param string $message
|
125 |
+
* @see \Codeception\Module\Asserts::assertSame()
|
126 |
+
*/
|
127 |
+
public function assertSame($expected, $actual, $message = null) {
|
128 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args()));
|
129 |
+
}
|
130 |
+
|
131 |
+
|
132 |
+
/**
|
133 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
134 |
+
*
|
135 |
+
* Checks that two variables are not same
|
136 |
+
*
|
137 |
+
* @param $expected
|
138 |
+
* @param $actual
|
139 |
+
* @param string $message
|
140 |
+
* @see \Codeception\Module\Asserts::assertNotSame()
|
141 |
+
*/
|
142 |
+
public function assertNotSame($expected, $actual, $message = null) {
|
143 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args()));
|
144 |
+
}
|
145 |
+
|
146 |
+
|
147 |
+
/**
|
148 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
149 |
+
*
|
150 |
+
* Checks that actual is greater than expected
|
151 |
+
*
|
152 |
+
* @param $expected
|
153 |
+
* @param $actual
|
154 |
+
* @param string $message
|
155 |
+
* @see \Codeception\Module\Asserts::assertGreaterThan()
|
156 |
+
*/
|
157 |
+
public function assertGreaterThan($expected, $actual, $message = null) {
|
158 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args()));
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
/**
|
163 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
164 |
+
*
|
165 |
+
* Checks that actual is greater or equal than expected
|
166 |
+
*
|
167 |
+
* @param $expected
|
168 |
+
* @param $actual
|
169 |
+
* @param string $message
|
170 |
+
* @see \Codeception\Module\Asserts::assertGreaterThanOrEqual()
|
171 |
+
*/
|
172 |
+
public function assertGreaterThanOrEqual($expected, $actual, $message = null) {
|
173 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args()));
|
174 |
+
}
|
175 |
+
|
176 |
+
|
177 |
+
/**
|
178 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
179 |
+
*
|
180 |
+
* Checks that actual is less than expected
|
181 |
+
*
|
182 |
+
* @param $expected
|
183 |
+
* @param $actual
|
184 |
+
* @param string $message
|
185 |
+
* @see \Codeception\Module\Asserts::assertLessThan()
|
186 |
+
*/
|
187 |
+
public function assertLessThan($expected, $actual, $message = null) {
|
188 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args()));
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
+
/**
|
193 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
194 |
+
*
|
195 |
+
* Checks that actual is less or equal than expected
|
196 |
+
*
|
197 |
+
* @param $expected
|
198 |
+
* @param $actual
|
199 |
+
* @param string $message
|
200 |
+
* @see \Codeception\Module\Asserts::assertLessThanOrEqual()
|
201 |
+
*/
|
202 |
+
public function assertLessThanOrEqual($expected, $actual, $message = null) {
|
203 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args()));
|
204 |
+
}
|
205 |
+
|
206 |
+
|
207 |
+
/**
|
208 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
209 |
+
*
|
210 |
+
* Checks that haystack contains needle
|
211 |
+
*
|
212 |
+
* @param $needle
|
213 |
+
* @param $haystack
|
214 |
+
* @param string $message
|
215 |
+
* @see \Codeception\Module\Asserts::assertContains()
|
216 |
+
*/
|
217 |
+
public function assertContains($needle, $haystack, $message = null) {
|
218 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args()));
|
219 |
+
}
|
220 |
+
|
221 |
+
|
222 |
+
/**
|
223 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
224 |
+
*
|
225 |
+
* Checks that haystack doesn't contain needle.
|
226 |
+
*
|
227 |
+
* @param $needle
|
228 |
+
* @param $haystack
|
229 |
+
* @param string $message
|
230 |
+
* @see \Codeception\Module\Asserts::assertNotContains()
|
231 |
+
*/
|
232 |
+
public function assertNotContains($needle, $haystack, $message = null) {
|
233 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args()));
|
234 |
+
}
|
235 |
+
|
236 |
+
|
237 |
+
/**
|
238 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
239 |
+
*
|
240 |
+
* Checks that string match with pattern
|
241 |
+
*
|
242 |
+
* @param string $pattern
|
243 |
+
* @param string $string
|
244 |
+
* @param string $message
|
245 |
+
* @see \Codeception\Module\Asserts::assertRegExp()
|
246 |
+
*/
|
247 |
+
public function assertRegExp($pattern, $string, $message = null) {
|
248 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args()));
|
249 |
+
}
|
250 |
+
|
251 |
+
|
252 |
+
/**
|
253 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
254 |
+
*
|
255 |
+
* Checks that string match with pattern
|
256 |
+
*
|
257 |
+
* Alias of assertRegExp
|
258 |
+
* @param string $pattern
|
259 |
+
* @param string $string
|
260 |
+
* @param string $message
|
261 |
+
* @see \Codeception\Module\Asserts::assertMatchesRegularExpression()
|
262 |
+
*/
|
263 |
+
public function assertMatchesRegularExpression($pattern, $string, $message = null) {
|
264 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertMatchesRegularExpression', func_get_args()));
|
265 |
+
}
|
266 |
+
|
267 |
+
|
268 |
+
/**
|
269 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
270 |
+
*
|
271 |
+
* Checks that string not match with pattern
|
272 |
+
*
|
273 |
+
* @param string $pattern
|
274 |
+
* @param string $string
|
275 |
+
* @param string $message
|
276 |
+
* @see \Codeception\Module\Asserts::assertNotRegExp()
|
277 |
+
*/
|
278 |
+
public function assertNotRegExp($pattern, $string, $message = null) {
|
279 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args()));
|
280 |
+
}
|
281 |
+
|
282 |
+
|
283 |
+
/**
|
284 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
285 |
+
*
|
286 |
+
* Checks that string not match with pattern
|
287 |
+
*
|
288 |
+
* Alias of assertNotRegExp
|
289 |
+
* @param string $pattern
|
290 |
+
* @param string $string
|
291 |
+
* @param string $message
|
292 |
+
* @see \Codeception\Module\Asserts::assertDoesNotMatchRegularExpression()
|
293 |
+
*/
|
294 |
+
public function assertDoesNotMatchRegularExpression($pattern, $string, $message = null) {
|
295 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDoesNotMatchRegularExpression', func_get_args()));
|
296 |
+
}
|
297 |
+
|
298 |
+
|
299 |
+
/**
|
300 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
301 |
+
*
|
302 |
+
* Checks that a string starts with the given prefix.
|
303 |
+
*
|
304 |
+
* @param string $prefix
|
305 |
+
* @param string $string
|
306 |
+
* @param string $message
|
307 |
+
* @see \Codeception\Module\Asserts::assertStringStartsWith()
|
308 |
+
*/
|
309 |
+
public function assertStringStartsWith($prefix, $string, $message = null) {
|
310 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args()));
|
311 |
+
}
|
312 |
+
|
313 |
+
|
314 |
+
/**
|
315 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
316 |
+
*
|
317 |
+
* Checks that a string doesn't start with the given prefix.
|
318 |
+
*
|
319 |
+
* @param string $prefix
|
320 |
+
* @param string $string
|
321 |
+
* @param string $message
|
322 |
+
* @see \Codeception\Module\Asserts::assertStringStartsNotWith()
|
323 |
+
*/
|
324 |
+
public function assertStringStartsNotWith($prefix, $string, $message = null) {
|
325 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args()));
|
326 |
+
}
|
327 |
+
|
328 |
+
|
329 |
+
/**
|
330 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
331 |
+
*
|
332 |
+
* Checks that variable is empty.
|
333 |
+
*
|
334 |
+
* @param $actual
|
335 |
+
* @param string $message
|
336 |
+
* @see \Codeception\Module\Asserts::assertEmpty()
|
337 |
+
*/
|
338 |
+
public function assertEmpty($actual, $message = null) {
|
339 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args()));
|
340 |
+
}
|
341 |
+
|
342 |
+
|
343 |
+
/**
|
344 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
345 |
+
*
|
346 |
+
* Checks that variable is not empty.
|
347 |
+
*
|
348 |
+
* @param $actual
|
349 |
+
* @param string $message
|
350 |
+
* @see \Codeception\Module\Asserts::assertNotEmpty()
|
351 |
+
*/
|
352 |
+
public function assertNotEmpty($actual, $message = null) {
|
353 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args()));
|
354 |
+
}
|
355 |
+
|
356 |
+
|
357 |
+
/**
|
358 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
359 |
+
*
|
360 |
+
* Checks that variable is NULL
|
361 |
+
*
|
362 |
+
* @param $actual
|
363 |
+
* @param string $message
|
364 |
+
* @see \Codeception\Module\Asserts::assertNull()
|
365 |
+
*/
|
366 |
+
public function assertNull($actual, $message = null) {
|
367 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args()));
|
368 |
+
}
|
369 |
+
|
370 |
+
|
371 |
+
/**
|
372 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
373 |
+
*
|
374 |
+
* Checks that variable is not NULL
|
375 |
+
*
|
376 |
+
* @param $actual
|
377 |
+
* @param string $message
|
378 |
+
* @see \Codeception\Module\Asserts::assertNotNull()
|
379 |
+
*/
|
380 |
+
public function assertNotNull($actual, $message = null) {
|
381 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args()));
|
382 |
+
}
|
383 |
+
|
384 |
+
|
385 |
+
/**
|
386 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
387 |
+
*
|
388 |
+
* Checks that condition is positive.
|
389 |
+
*
|
390 |
+
* @param $condition
|
391 |
+
* @param string $message
|
392 |
+
* @see \Codeception\Module\Asserts::assertTrue()
|
393 |
+
*/
|
394 |
+
public function assertTrue($condition, $message = null) {
|
395 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args()));
|
396 |
+
}
|
397 |
+
|
398 |
+
|
399 |
+
/**
|
400 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
401 |
+
*
|
402 |
+
* Checks that the condition is NOT true (everything but true)
|
403 |
+
*
|
404 |
+
* @param $condition
|
405 |
+
* @param string $message
|
406 |
+
* @see \Codeception\Module\Asserts::assertNotTrue()
|
407 |
+
*/
|
408 |
+
public function assertNotTrue($condition, $message = null) {
|
409 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotTrue', func_get_args()));
|
410 |
+
}
|
411 |
+
|
412 |
+
|
413 |
+
/**
|
414 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
415 |
+
*
|
416 |
+
* Checks that condition is negative.
|
417 |
+
*
|
418 |
+
* @param $condition
|
419 |
+
* @param string $message
|
420 |
+
* @see \Codeception\Module\Asserts::assertFalse()
|
421 |
+
*/
|
422 |
+
public function assertFalse($condition, $message = null) {
|
423 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args()));
|
424 |
+
}
|
425 |
+
|
426 |
+
|
427 |
+
/**
|
428 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
429 |
+
*
|
430 |
+
* Checks that the condition is NOT false (everything but false)
|
431 |
+
*
|
432 |
+
* @param $condition
|
433 |
+
* @param string $message
|
434 |
+
* @see \Codeception\Module\Asserts::assertNotFalse()
|
435 |
+
*/
|
436 |
+
public function assertNotFalse($condition, $message = null) {
|
437 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotFalse', func_get_args()));
|
438 |
+
}
|
439 |
+
|
440 |
+
|
441 |
+
/**
|
442 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
443 |
+
*
|
444 |
+
* Checks if file exists
|
445 |
+
*
|
446 |
+
* @param string $filename
|
447 |
+
* @param string $message
|
448 |
+
* @see \Codeception\Module\Asserts::assertFileExists()
|
449 |
+
*/
|
450 |
+
public function assertFileExists($filename, $message = null) {
|
451 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args()));
|
452 |
+
}
|
453 |
+
|
454 |
+
|
455 |
+
/**
|
456 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
457 |
+
*
|
458 |
+
* Checks if file doesn't exist
|
459 |
+
*
|
460 |
+
* @param string $filename
|
461 |
+
* @param string $message
|
462 |
+
* @see \Codeception\Module\Asserts::assertFileNotExists()
|
463 |
+
*/
|
464 |
+
public function assertFileNotExists($filename, $message = null) {
|
465 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args()));
|
466 |
+
}
|
467 |
+
|
468 |
+
|
469 |
+
/**
|
470 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
471 |
+
*
|
472 |
+
* Checks if file doesn't exist
|
473 |
+
*
|
474 |
+
* Alias of assertFileNotExists
|
475 |
+
* @param string $filename
|
476 |
+
* @param string $message
|
477 |
+
* @see \Codeception\Module\Asserts::assertFileDoesNotExist()
|
478 |
+
*/
|
479 |
+
public function assertFileDoesNotExist($filename, $message = null) {
|
480 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileDoesNotExist', func_get_args()));
|
481 |
+
}
|
482 |
+
|
483 |
+
|
484 |
+
/**
|
485 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
486 |
+
*
|
487 |
+
* @param $expected
|
488 |
+
* @param $actual
|
489 |
+
* @param $description
|
490 |
+
* @see \Codeception\Module\Asserts::assertGreaterOrEquals()
|
491 |
+
*/
|
492 |
+
public function assertGreaterOrEquals($expected, $actual, $description = null) {
|
493 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args()));
|
494 |
+
}
|
495 |
+
|
496 |
+
|
497 |
+
/**
|
498 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
499 |
+
*
|
500 |
+
* @param $expected
|
501 |
+
* @param $actual
|
502 |
+
* @param $description
|
503 |
+
* @see \Codeception\Module\Asserts::assertLessOrEquals()
|
504 |
+
*/
|
505 |
+
public function assertLessOrEquals($expected, $actual, $description = null) {
|
506 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args()));
|
507 |
+
}
|
508 |
+
|
509 |
+
|
510 |
+
/**
|
511 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
512 |
+
*
|
513 |
+
* @param $actual
|
514 |
+
* @param $description
|
515 |
+
* @see \Codeception\Module\Asserts::assertIsEmpty()
|
516 |
+
*/
|
517 |
+
public function assertIsEmpty($actual, $description = null) {
|
518 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args()));
|
519 |
+
}
|
520 |
+
|
521 |
+
|
522 |
+
/**
|
523 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
524 |
+
*
|
525 |
+
* @param $key
|
526 |
+
* @param $actual
|
527 |
+
* @param $description
|
528 |
+
* @see \Codeception\Module\Asserts::assertArrayHasKey()
|
529 |
+
*/
|
530 |
+
public function assertArrayHasKey($key, $actual, $description = null) {
|
531 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args()));
|
532 |
+
}
|
533 |
+
|
534 |
+
|
535 |
+
/**
|
536 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
537 |
+
*
|
538 |
+
* @param $key
|
539 |
+
* @param $actual
|
540 |
+
* @param $description
|
541 |
+
* @see \Codeception\Module\Asserts::assertArrayNotHasKey()
|
542 |
+
*/
|
543 |
+
public function assertArrayNotHasKey($key, $actual, $description = null) {
|
544 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args()));
|
545 |
+
}
|
546 |
+
|
547 |
+
|
548 |
+
/**
|
549 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
550 |
+
*
|
551 |
+
* @param $expectedCount
|
552 |
+
* @param $actual
|
553 |
+
* @param $description
|
554 |
+
* @see \Codeception\Module\Asserts::assertCount()
|
555 |
+
*/
|
556 |
+
public function assertCount($expectedCount, $actual, $description = null) {
|
557 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args()));
|
558 |
+
}
|
559 |
+
|
560 |
+
|
561 |
+
/**
|
562 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
563 |
+
*
|
564 |
+
* @param $class
|
565 |
+
* @param $actual
|
566 |
+
* @param $description
|
567 |
+
* @see \Codeception\Module\Asserts::assertInstanceOf()
|
568 |
+
*/
|
569 |
+
public function assertInstanceOf($class, $actual, $description = null) {
|
570 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args()));
|
571 |
+
}
|
572 |
+
|
573 |
+
|
574 |
+
/**
|
575 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
576 |
+
*
|
577 |
+
* @param $class
|
578 |
+
* @param $actual
|
579 |
+
* @param $description
|
580 |
+
* @see \Codeception\Module\Asserts::assertNotInstanceOf()
|
581 |
+
*/
|
582 |
+
public function assertNotInstanceOf($class, $actual, $description = null) {
|
583 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args()));
|
584 |
+
}
|
585 |
+
|
586 |
+
|
587 |
+
/**
|
588 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
589 |
+
*
|
590 |
+
* @param $type
|
591 |
+
* @param $actual
|
592 |
+
* @param $description
|
593 |
+
* @see \Codeception\Module\Asserts::assertInternalType()
|
594 |
+
*/
|
595 |
+
public function assertInternalType($type, $actual, $description = null) {
|
596 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args()));
|
597 |
+
}
|
598 |
+
|
599 |
+
|
600 |
+
/**
|
601 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
602 |
+
*
|
603 |
+
* Fails the test with message.
|
604 |
+
*
|
605 |
+
* @param $message
|
606 |
+
* @see \Codeception\Module\Asserts::fail()
|
607 |
+
*/
|
608 |
+
public function fail($message) {
|
609 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args()));
|
610 |
+
}
|
611 |
+
|
612 |
+
|
613 |
+
/**
|
614 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
615 |
+
*
|
616 |
+
*
|
617 |
+
* @see \Codeception\Module\Asserts::assertStringContainsString()
|
618 |
+
*/
|
619 |
+
public function assertStringContainsString($needle, $haystack, $message = null) {
|
620 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsString', func_get_args()));
|
621 |
+
}
|
622 |
+
|
623 |
+
|
624 |
+
/**
|
625 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
626 |
+
*
|
627 |
+
*
|
628 |
+
* @see \Codeception\Module\Asserts::assertStringNotContainsString()
|
629 |
+
*/
|
630 |
+
public function assertStringNotContainsString($needle, $haystack, $message = null) {
|
631 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsString', func_get_args()));
|
632 |
+
}
|
633 |
+
|
634 |
+
|
635 |
+
/**
|
636 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
637 |
+
*
|
638 |
+
*
|
639 |
+
* @see \Codeception\Module\Asserts::assertStringContainsStringIgnoringCase()
|
640 |
+
*/
|
641 |
+
public function assertStringContainsStringIgnoringCase($needle, $haystack, $message = null) {
|
642 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsStringIgnoringCase', func_get_args()));
|
643 |
+
}
|
644 |
+
|
645 |
+
|
646 |
+
/**
|
647 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
648 |
+
*
|
649 |
+
*
|
650 |
+
* @see \Codeception\Module\Asserts::assertStringNotContainsStringIgnoringCase()
|
651 |
+
*/
|
652 |
+
public function assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = null) {
|
653 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsStringIgnoringCase', func_get_args()));
|
654 |
+
}
|
655 |
+
|
656 |
+
|
657 |
+
/**
|
658 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
659 |
+
*
|
660 |
+
* @since 1.1.0 of module-asserts
|
661 |
+
* @see \Codeception\Module\Asserts::assertStringEndsWith()
|
662 |
+
*/
|
663 |
+
public function assertStringEndsWith($suffix, $string, $message = null) {
|
664 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsWith', func_get_args()));
|
665 |
+
}
|
666 |
+
|
667 |
+
|
668 |
+
/**
|
669 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
670 |
+
*
|
671 |
+
* @since 1.1.0 of module-asserts
|
672 |
+
* @see \Codeception\Module\Asserts::assertStringEndsNotWith()
|
673 |
+
*/
|
674 |
+
public function assertStringEndsNotWith($suffix, $string, $message = null) {
|
675 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsNotWith', func_get_args()));
|
676 |
+
}
|
677 |
+
|
678 |
+
|
679 |
+
/**
|
680 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
681 |
+
*
|
682 |
+
*
|
683 |
+
* @see \Codeception\Module\Asserts::assertIsArray()
|
684 |
+
*/
|
685 |
+
public function assertIsArray($actual, $message = null) {
|
686 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsArray', func_get_args()));
|
687 |
+
}
|
688 |
+
|
689 |
+
|
690 |
+
/**
|
691 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
692 |
+
*
|
693 |
+
*
|
694 |
+
* @see \Codeception\Module\Asserts::assertIsBool()
|
695 |
+
*/
|
696 |
+
public function assertIsBool($actual, $message = null) {
|
697 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsBool', func_get_args()));
|
698 |
+
}
|
699 |
+
|
700 |
+
|
701 |
+
/**
|
702 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
703 |
+
*
|
704 |
+
*
|
705 |
+
* @see \Codeception\Module\Asserts::assertIsFloat()
|
706 |
+
*/
|
707 |
+
public function assertIsFloat($actual, $message = null) {
|
708 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsFloat', func_get_args()));
|
709 |
+
}
|
710 |
+
|
711 |
+
|
712 |
+
/**
|
713 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
714 |
+
*
|
715 |
+
*
|
716 |
+
* @see \Codeception\Module\Asserts::assertIsInt()
|
717 |
+
*/
|
718 |
+
public function assertIsInt($actual, $message = null) {
|
719 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsInt', func_get_args()));
|
720 |
+
}
|
721 |
+
|
722 |
+
|
723 |
+
/**
|
724 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
725 |
+
*
|
726 |
+
*
|
727 |
+
* @see \Codeception\Module\Asserts::assertIsNumeric()
|
728 |
+
*/
|
729 |
+
public function assertIsNumeric($actual, $message = null) {
|
730 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNumeric', func_get_args()));
|
731 |
+
}
|
732 |
+
|
733 |
+
|
734 |
+
/**
|
735 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
736 |
+
*
|
737 |
+
*
|
738 |
+
* @see \Codeception\Module\Asserts::assertIsObject()
|
739 |
+
*/
|
740 |
+
public function assertIsObject($actual, $message = null) {
|
741 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsObject', func_get_args()));
|
742 |
+
}
|
743 |
+
|
744 |
+
|
745 |
+
/**
|
746 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
747 |
+
*
|
748 |
+
*
|
749 |
+
* @see \Codeception\Module\Asserts::assertIsResource()
|
750 |
+
*/
|
751 |
+
public function assertIsResource($actual, $message = null) {
|
752 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsResource', func_get_args()));
|
753 |
+
}
|
754 |
+
|
755 |
+
|
756 |
+
/**
|
757 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
758 |
+
*
|
759 |
+
*
|
760 |
+
* @see \Codeception\Module\Asserts::assertIsString()
|
761 |
+
*/
|
762 |
+
public function assertIsString($actual, $message = null) {
|
763 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsString', func_get_args()));
|
764 |
+
}
|
765 |
+
|
766 |
+
|
767 |
+
/**
|
768 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
769 |
+
*
|
770 |
+
*
|
771 |
+
* @see \Codeception\Module\Asserts::assertIsScalar()
|
772 |
+
*/
|
773 |
+
public function assertIsScalar($actual, $message = null) {
|
774 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsScalar', func_get_args()));
|
775 |
+
}
|
776 |
+
|
777 |
+
|
778 |
+
/**
|
779 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
780 |
+
*
|
781 |
+
*
|
782 |
+
* @see \Codeception\Module\Asserts::assertIsCallable()
|
783 |
+
*/
|
784 |
+
public function assertIsCallable($actual, $message = null) {
|
785 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsCallable', func_get_args()));
|
786 |
+
}
|
787 |
+
|
788 |
+
|
789 |
+
/**
|
790 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
791 |
+
*
|
792 |
+
*
|
793 |
+
* @see \Codeception\Module\Asserts::assertIsNotArray()
|
794 |
+
*/
|
795 |
+
public function assertIsNotArray($actual, $message = null) {
|
796 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotArray', func_get_args()));
|
797 |
+
}
|
798 |
+
|
799 |
+
|
800 |
+
/**
|
801 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
802 |
+
*
|
803 |
+
*
|
804 |
+
* @see \Codeception\Module\Asserts::assertIsNotBool()
|
805 |
+
*/
|
806 |
+
public function assertIsNotBool($actual, $message = null) {
|
807 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotBool', func_get_args()));
|
808 |
+
}
|
809 |
+
|
810 |
+
|
811 |
+
/**
|
812 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
813 |
+
*
|
814 |
+
*
|
815 |
+
* @see \Codeception\Module\Asserts::assertIsNotFloat()
|
816 |
+
*/
|
817 |
+
public function assertIsNotFloat($actual, $message = null) {
|
818 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotFloat', func_get_args()));
|
819 |
+
}
|
820 |
+
|
821 |
+
|
822 |
+
/**
|
823 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
824 |
+
*
|
825 |
+
*
|
826 |
+
* @see \Codeception\Module\Asserts::assertIsNotInt()
|
827 |
+
*/
|
828 |
+
public function assertIsNotInt($actual, $message = null) {
|
829 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotInt', func_get_args()));
|
830 |
+
}
|
831 |
+
|
832 |
+
|
833 |
+
/**
|
834 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
835 |
+
*
|
836 |
+
*
|
837 |
+
* @see \Codeception\Module\Asserts::assertIsNotNumeric()
|
838 |
+
*/
|
839 |
+
public function assertIsNotNumeric($actual, $message = null) {
|
840 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotNumeric', func_get_args()));
|
841 |
+
}
|
842 |
+
|
843 |
+
|
844 |
+
/**
|
845 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
846 |
+
*
|
847 |
+
*
|
848 |
+
* @see \Codeception\Module\Asserts::assertIsNotObject()
|
849 |
+
*/
|
850 |
+
public function assertIsNotObject($actual, $message = null) {
|
851 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotObject', func_get_args()));
|
852 |
+
}
|
853 |
+
|
854 |
+
|
855 |
+
/**
|
856 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
857 |
+
*
|
858 |
+
*
|
859 |
+
* @see \Codeception\Module\Asserts::assertIsNotResource()
|
860 |
+
*/
|
861 |
+
public function assertIsNotResource($actual, $message = null) {
|
862 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotResource', func_get_args()));
|
863 |
+
}
|
864 |
+
|
865 |
+
|
866 |
+
/**
|
867 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
868 |
+
*
|
869 |
+
*
|
870 |
+
* @see \Codeception\Module\Asserts::assertIsNotString()
|
871 |
+
*/
|
872 |
+
public function assertIsNotString($actual, $message = null) {
|
873 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotString', func_get_args()));
|
874 |
+
}
|
875 |
+
|
876 |
+
|
877 |
+
/**
|
878 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
879 |
+
*
|
880 |
+
*
|
881 |
+
* @see \Codeception\Module\Asserts::assertIsNotScalar()
|
882 |
+
*/
|
883 |
+
public function assertIsNotScalar($actual, $message = null) {
|
884 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotScalar', func_get_args()));
|
885 |
+
}
|
886 |
+
|
887 |
+
|
888 |
+
/**
|
889 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
890 |
+
*
|
891 |
+
*
|
892 |
+
* @see \Codeception\Module\Asserts::assertIsNotCallable()
|
893 |
+
*/
|
894 |
+
public function assertIsNotCallable($actual, $message = null) {
|
895 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotCallable', func_get_args()));
|
896 |
+
}
|
897 |
+
|
898 |
+
|
899 |
+
/**
|
900 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
901 |
+
*
|
902 |
+
*
|
903 |
+
* @see \Codeception\Module\Asserts::assertEqualsCanonicalizing()
|
904 |
+
*/
|
905 |
+
public function assertEqualsCanonicalizing($expected, $actual, $message = null) {
|
906 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsCanonicalizing', func_get_args()));
|
907 |
+
}
|
908 |
+
|
909 |
+
|
910 |
+
/**
|
911 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
912 |
+
*
|
913 |
+
*
|
914 |
+
* @see \Codeception\Module\Asserts::assertNotEqualsCanonicalizing()
|
915 |
+
*/
|
916 |
+
public function assertNotEqualsCanonicalizing($expected, $actual, $message = null) {
|
917 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsCanonicalizing', func_get_args()));
|
918 |
+
}
|
919 |
+
|
920 |
+
|
921 |
+
/**
|
922 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
923 |
+
*
|
924 |
+
*
|
925 |
+
* @see \Codeception\Module\Asserts::assertEqualsIgnoringCase()
|
926 |
+
*/
|
927 |
+
public function assertEqualsIgnoringCase($expected, $actual, $message = null) {
|
928 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsIgnoringCase', func_get_args()));
|
929 |
+
}
|
930 |
+
|
931 |
+
|
932 |
+
/**
|
933 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
934 |
+
*
|
935 |
+
*
|
936 |
+
* @see \Codeception\Module\Asserts::assertNotEqualsIgnoringCase()
|
937 |
+
*/
|
938 |
+
public function assertNotEqualsIgnoringCase($expected, $actual, $message = null) {
|
939 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsIgnoringCase', func_get_args()));
|
940 |
+
}
|
941 |
+
|
942 |
+
|
943 |
+
/**
|
944 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
945 |
+
*
|
946 |
+
*
|
947 |
+
* @see \Codeception\Module\Asserts::assertEqualsWithDelta()
|
948 |
+
*/
|
949 |
+
public function assertEqualsWithDelta($expected, $actual, $delta, $message = null) {
|
950 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsWithDelta', func_get_args()));
|
951 |
+
}
|
952 |
+
|
953 |
+
|
954 |
+
/**
|
955 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
956 |
+
*
|
957 |
+
*
|
958 |
+
* @see \Codeception\Module\Asserts::assertNotEqualsWithDelta()
|
959 |
+
*/
|
960 |
+
public function assertNotEqualsWithDelta($expected, $actual, $delta, $message = null) {
|
961 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsWithDelta', func_get_args()));
|
962 |
+
}
|
963 |
+
}
|
@@ -0,0 +1,963 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //[STAMP] 7deed06224ad7d978f6da9d65bd4d8c5
|
2 |
+
namespace _generated;
|
3 |
+
|
4 |
+
// This class was automatically generated by build task
|
5 |
+
// You should not change it manually as it will be overwritten on next build
|
6 |
+
// @codingStandardsIgnoreFile
|
7 |
+
|
8 |
+
trait UnitTesterActions
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* @return \Codeception\Scenario
|
12 |
+
*/
|
13 |
+
abstract protected function getScenario();
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
18 |
+
*
|
19 |
+
* Handles and checks exception called inside callback function.
|
20 |
+
* Either exception class name or exception instance should be provided.
|
21 |
+
*
|
22 |
+
* ```php
|
23 |
+
* <?php
|
24 |
+
* $I->expectException(MyException::class, function() {
|
25 |
+
* $this->doSomethingBad();
|
26 |
+
* });
|
27 |
+
*
|
28 |
+
* $I->expectException(new MyException(), function() {
|
29 |
+
* $this->doSomethingBad();
|
30 |
+
* });
|
31 |
+
* ```
|
32 |
+
* If you want to check message or exception code, you can pass them with exception instance:
|
33 |
+
* ```php
|
34 |
+
* <?php
|
35 |
+
* // will check that exception MyException is thrown with "Don't do bad things" message
|
36 |
+
* $I->expectException(new MyException("Don't do bad things"), function() {
|
37 |
+
* $this->doSomethingBad();
|
38 |
+
* });
|
39 |
+
* ```
|
40 |
+
*
|
41 |
+
* @deprecated Use expectThrowable() instead
|
42 |
+
* @param $exception string or \Exception
|
43 |
+
* @param $callback
|
44 |
+
* @see \Codeception\Module\Asserts::expectException()
|
45 |
+
*/
|
46 |
+
public function expectException($exception, $callback) {
|
47 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args()));
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
/**
|
52 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
53 |
+
*
|
54 |
+
* Handles and checks throwables (Exceptions/Errors) called inside the callback function.
|
55 |
+
* Either throwable class name or throwable instance should be provided.
|
56 |
+
*
|
57 |
+
* ```php
|
58 |
+
* <?php
|
59 |
+
* $I->expectThrowable(MyThrowable::class, function() {
|
60 |
+
* $this->doSomethingBad();
|
61 |
+
* });
|
62 |
+
*
|
63 |
+
* $I->expectThrowable(new MyException(), function() {
|
64 |
+
* $this->doSomethingBad();
|
65 |
+
* });
|
66 |
+
* ```
|
67 |
+
* If you want to check message or throwable code, you can pass them with throwable instance:
|
68 |
+
* ```php
|
69 |
+
* <?php
|
70 |
+
* // will check that throwable MyError is thrown with "Don't do bad things" message
|
71 |
+
* $I->expectThrowable(new MyError("Don't do bad things"), function() {
|
72 |
+
* $this->doSomethingBad();
|
73 |
+
* });
|
74 |
+
* ```
|
75 |
+
*
|
76 |
+
* @param $throwable string or \Throwable
|
77 |
+
* @param $callback
|
78 |
+
* @see \Codeception\Module\Asserts::expectThrowable()
|
79 |
+
*/
|
80 |
+
public function expectThrowable($throwable, $callback) {
|
81 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectThrowable', func_get_args()));
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
/**
|
86 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
87 |
+
*
|
88 |
+
* Checks that two variables are equal.
|
89 |
+
*
|
90 |
+
* @param $expected
|
91 |
+
* @param $actual
|
92 |
+
* @param string $message
|
93 |
+
* @param float $delta
|
94 |
+
* @see \Codeception\Module\Asserts::assertEquals()
|
95 |
+
*/
|
96 |
+
public function assertEquals($expected, $actual, $message = null, $delta = null) {
|
97 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
103 |
+
*
|
104 |
+
* Checks that two variables are not equal
|
105 |
+
*
|
106 |
+
* @param $expected
|
107 |
+
* @param $actual
|
108 |
+
* @param string $message
|
109 |
+
* @param float $delta
|
110 |
+
* @see \Codeception\Module\Asserts::assertNotEquals()
|
111 |
+
*/
|
112 |
+
public function assertNotEquals($expected, $actual, $message = null, $delta = null) {
|
113 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
119 |
+
*
|
120 |
+
* Checks that two variables are same
|
121 |
+
*
|
122 |
+
* @param $expected
|
123 |
+
* @param $actual
|
124 |
+
* @param string $message
|
125 |
+
* @see \Codeception\Module\Asserts::assertSame()
|
126 |
+
*/
|
127 |
+
public function assertSame($expected, $actual, $message = null) {
|
128 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args()));
|
129 |
+
}
|
130 |
+
|
131 |
+
|
132 |
+
/**
|
133 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
134 |
+
*
|
135 |
+
* Checks that two variables are not same
|
136 |
+
*
|
137 |
+
* @param $expected
|
138 |
+
* @param $actual
|
139 |
+
* @param string $message
|
140 |
+
* @see \Codeception\Module\Asserts::assertNotSame()
|
141 |
+
*/
|
142 |
+
public function assertNotSame($expected, $actual, $message = null) {
|
143 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args()));
|
144 |
+
}
|
145 |
+
|
146 |
+
|
147 |
+
/**
|
148 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
149 |
+
*
|
150 |
+
* Checks that actual is greater than expected
|
151 |
+
*
|
152 |
+
* @param $expected
|
153 |
+
* @param $actual
|
154 |
+
* @param string $message
|
155 |
+
* @see \Codeception\Module\Asserts::assertGreaterThan()
|
156 |
+
*/
|
157 |
+
public function assertGreaterThan($expected, $actual, $message = null) {
|
158 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args()));
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
/**
|
163 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
164 |
+
*
|
165 |
+
* Checks that actual is greater or equal than expected
|
166 |
+
*
|
167 |
+
* @param $expected
|
168 |
+
* @param $actual
|
169 |
+
* @param string $message
|
170 |
+
* @see \Codeception\Module\Asserts::assertGreaterThanOrEqual()
|
171 |
+
*/
|
172 |
+
public function assertGreaterThanOrEqual($expected, $actual, $message = null) {
|
173 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args()));
|
174 |
+
}
|
175 |
+
|
176 |
+
|
177 |
+
/**
|
178 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
179 |
+
*
|
180 |
+
* Checks that actual is less than expected
|
181 |
+
*
|
182 |
+
* @param $expected
|
183 |
+
* @param $actual
|
184 |
+
* @param string $message
|
185 |
+
* @see \Codeception\Module\Asserts::assertLessThan()
|
186 |
+
*/
|
187 |
+
public function assertLessThan($expected, $actual, $message = null) {
|
188 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args()));
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
+
/**
|
193 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
194 |
+
*
|
195 |
+
* Checks that actual is less or equal than expected
|
196 |
+
*
|
197 |
+
* @param $expected
|
198 |
+
* @param $actual
|
199 |
+
* @param string $message
|
200 |
+
* @see \Codeception\Module\Asserts::assertLessThanOrEqual()
|
201 |
+
*/
|
202 |
+
public function assertLessThanOrEqual($expected, $actual, $message = null) {
|
203 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args()));
|
204 |
+
}
|
205 |
+
|
206 |
+
|
207 |
+
/**
|
208 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
209 |
+
*
|
210 |
+
* Checks that haystack contains needle
|
211 |
+
*
|
212 |
+
* @param $needle
|
213 |
+
* @param $haystack
|
214 |
+
* @param string $message
|
215 |
+
* @see \Codeception\Module\Asserts::assertContains()
|
216 |
+
*/
|
217 |
+
public function assertContains($needle, $haystack, $message = null) {
|
218 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args()));
|
219 |
+
}
|
220 |
+
|
221 |
+
|
222 |
+
/**
|
223 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
224 |
+
*
|
225 |
+
* Checks that haystack doesn't contain needle.
|
226 |
+
*
|
227 |
+
* @param $needle
|
228 |
+
* @param $haystack
|
229 |
+
* @param string $message
|
230 |
+
* @see \Codeception\Module\Asserts::assertNotContains()
|
231 |
+
*/
|
232 |
+
public function assertNotContains($needle, $haystack, $message = null) {
|
233 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args()));
|
234 |
+
}
|
235 |
+
|
236 |
+
|
237 |
+
/**
|
238 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
239 |
+
*
|
240 |
+
* Checks that string match with pattern
|
241 |
+
*
|
242 |
+
* @param string $pattern
|
243 |
+
* @param string $string
|
244 |
+
* @param string $message
|
245 |
+
* @see \Codeception\Module\Asserts::assertRegExp()
|
246 |
+
*/
|
247 |
+
public function assertRegExp($pattern, $string, $message = null) {
|
248 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args()));
|
249 |
+
}
|
250 |
+
|
251 |
+
|
252 |
+
/**
|
253 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
254 |
+
*
|
255 |
+
* Checks that string match with pattern
|
256 |
+
*
|
257 |
+
* Alias of assertRegExp
|
258 |
+
* @param string $pattern
|
259 |
+
* @param string $string
|
260 |
+
* @param string $message
|
261 |
+
* @see \Codeception\Module\Asserts::assertMatchesRegularExpression()
|
262 |
+
*/
|
263 |
+
public function assertMatchesRegularExpression($pattern, $string, $message = null) {
|
264 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertMatchesRegularExpression', func_get_args()));
|
265 |
+
}
|
266 |
+
|
267 |
+
|
268 |
+
/**
|
269 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
270 |
+
*
|
271 |
+
* Checks that string not match with pattern
|
272 |
+
*
|
273 |
+
* @param string $pattern
|
274 |
+
* @param string $string
|
275 |
+
* @param string $message
|
276 |
+
* @see \Codeception\Module\Asserts::assertNotRegExp()
|
277 |
+
*/
|
278 |
+
public function assertNotRegExp($pattern, $string, $message = null) {
|
279 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args()));
|
280 |
+
}
|
281 |
+
|
282 |
+
|
283 |
+
/**
|
284 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
285 |
+
*
|
286 |
+
* Checks that string not match with pattern
|
287 |
+
*
|
288 |
+
* Alias of assertNotRegExp
|
289 |
+
* @param string $pattern
|
290 |
+
* @param string $string
|
291 |
+
* @param string $message
|
292 |
+
* @see \Codeception\Module\Asserts::assertDoesNotMatchRegularExpression()
|
293 |
+
*/
|
294 |
+
public function assertDoesNotMatchRegularExpression($pattern, $string, $message = null) {
|
295 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDoesNotMatchRegularExpression', func_get_args()));
|
296 |
+
}
|
297 |
+
|
298 |
+
|
299 |
+
/**
|
300 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
301 |
+
*
|
302 |
+
* Checks that a string starts with the given prefix.
|
303 |
+
*
|
304 |
+
* @param string $prefix
|
305 |
+
* @param string $string
|
306 |
+
* @param string $message
|
307 |
+
* @see \Codeception\Module\Asserts::assertStringStartsWith()
|
308 |
+
*/
|
309 |
+
public function assertStringStartsWith($prefix, $string, $message = null) {
|
310 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args()));
|
311 |
+
}
|
312 |
+
|
313 |
+
|
314 |
+
/**
|
315 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
316 |
+
*
|
317 |
+
* Checks that a string doesn't start with the given prefix.
|
318 |
+
*
|
319 |
+
* @param string $prefix
|
320 |
+
* @param string $string
|
321 |
+
* @param string $message
|
322 |
+
* @see \Codeception\Module\Asserts::assertStringStartsNotWith()
|
323 |
+
*/
|
324 |
+
public function assertStringStartsNotWith($prefix, $string, $message = null) {
|
325 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args()));
|
326 |
+
}
|
327 |
+
|
328 |
+
|
329 |
+
/**
|
330 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
331 |
+
*
|
332 |
+
* Checks that variable is empty.
|
333 |
+
*
|
334 |
+
* @param $actual
|
335 |
+
* @param string $message
|
336 |
+
* @see \Codeception\Module\Asserts::assertEmpty()
|
337 |
+
*/
|
338 |
+
public function assertEmpty($actual, $message = null) {
|
339 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args()));
|
340 |
+
}
|
341 |
+
|
342 |
+
|
343 |
+
/**
|
344 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
345 |
+
*
|
346 |
+
* Checks that variable is not empty.
|
347 |
+
*
|
348 |
+
* @param $actual
|
349 |
+
* @param string $message
|
350 |
+
* @see \Codeception\Module\Asserts::assertNotEmpty()
|
351 |
+
*/
|
352 |
+
public function assertNotEmpty($actual, $message = null) {
|
353 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args()));
|
354 |
+
}
|
355 |
+
|
356 |
+
|
357 |
+
/**
|
358 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
359 |
+
*
|
360 |
+
* Checks that variable is NULL
|
361 |
+
*
|
362 |
+
* @param $actual
|
363 |
+
* @param string $message
|
364 |
+
* @see \Codeception\Module\Asserts::assertNull()
|
365 |
+
*/
|
366 |
+
public function assertNull($actual, $message = null) {
|
367 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args()));
|
368 |
+
}
|
369 |
+
|
370 |
+
|
371 |
+
/**
|
372 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
373 |
+
*
|
374 |
+
* Checks that variable is not NULL
|
375 |
+
*
|
376 |
+
* @param $actual
|
377 |
+
* @param string $message
|
378 |
+
* @see \Codeception\Module\Asserts::assertNotNull()
|
379 |
+
*/
|
380 |
+
public function assertNotNull($actual, $message = null) {
|
381 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args()));
|
382 |
+
}
|
383 |
+
|
384 |
+
|
385 |
+
/**
|
386 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
387 |
+
*
|
388 |
+
* Checks that condition is positive.
|
389 |
+
*
|
390 |
+
* @param $condition
|
391 |
+
* @param string $message
|
392 |
+
* @see \Codeception\Module\Asserts::assertTrue()
|
393 |
+
*/
|
394 |
+
public function assertTrue($condition, $message = null) {
|
395 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args()));
|
396 |
+
}
|
397 |
+
|
398 |
+
|
399 |
+
/**
|
400 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
401 |
+
*
|
402 |
+
* Checks that the condition is NOT true (everything but true)
|
403 |
+
*
|
404 |
+
* @param $condition
|
405 |
+
* @param string $message
|
406 |
+
* @see \Codeception\Module\Asserts::assertNotTrue()
|
407 |
+
*/
|
408 |
+
public function assertNotTrue($condition, $message = null) {
|
409 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotTrue', func_get_args()));
|
410 |
+
}
|
411 |
+
|
412 |
+
|
413 |
+
/**
|
414 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
415 |
+
*
|
416 |
+
* Checks that condition is negative.
|
417 |
+
*
|
418 |
+
* @param $condition
|
419 |
+
* @param string $message
|
420 |
+
* @see \Codeception\Module\Asserts::assertFalse()
|
421 |
+
*/
|
422 |
+
public function assertFalse($condition, $message = null) {
|
423 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args()));
|
424 |
+
}
|
425 |
+
|
426 |
+
|
427 |
+
/**
|
428 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
429 |
+
*
|
430 |
+
* Checks that the condition is NOT false (everything but false)
|
431 |
+
*
|
432 |
+
* @param $condition
|
433 |
+
* @param string $message
|
434 |
+
* @see \Codeception\Module\Asserts::assertNotFalse()
|
435 |
+
*/
|
436 |
+
public function assertNotFalse($condition, $message = null) {
|
437 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotFalse', func_get_args()));
|
438 |
+
}
|
439 |
+
|
440 |
+
|
441 |
+
/**
|
442 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
443 |
+
*
|
444 |
+
* Checks if file exists
|
445 |
+
*
|
446 |
+
* @param string $filename
|
447 |
+
* @param string $message
|
448 |
+
* @see \Codeception\Module\Asserts::assertFileExists()
|
449 |
+
*/
|
450 |
+
public function assertFileExists($filename, $message = null) {
|
451 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args()));
|
452 |
+
}
|
453 |
+
|
454 |
+
|
455 |
+
/**
|
456 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
457 |
+
*
|
458 |
+
* Checks if file doesn't exist
|
459 |
+
*
|
460 |
+
* @param string $filename
|
461 |
+
* @param string $message
|
462 |
+
* @see \Codeception\Module\Asserts::assertFileNotExists()
|
463 |
+
*/
|
464 |
+
public function assertFileNotExists($filename, $message = null) {
|
465 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args()));
|
466 |
+
}
|
467 |
+
|
468 |
+
|
469 |
+
/**
|
470 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
471 |
+
*
|
472 |
+
* Checks if file doesn't exist
|
473 |
+
*
|
474 |
+
* Alias of assertFileNotExists
|
475 |
+
* @param string $filename
|
476 |
+
* @param string $message
|
477 |
+
* @see \Codeception\Module\Asserts::assertFileDoesNotExist()
|
478 |
+
*/
|
479 |
+
public function assertFileDoesNotExist($filename, $message = null) {
|
480 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileDoesNotExist', func_get_args()));
|
481 |
+
}
|
482 |
+
|
483 |
+
|
484 |
+
/**
|
485 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
486 |
+
*
|
487 |
+
* @param $expected
|
488 |
+
* @param $actual
|
489 |
+
* @param $description
|
490 |
+
* @see \Codeception\Module\Asserts::assertGreaterOrEquals()
|
491 |
+
*/
|
492 |
+
public function assertGreaterOrEquals($expected, $actual, $description = null) {
|
493 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args()));
|
494 |
+
}
|
495 |
+
|
496 |
+
|
497 |
+
/**
|
498 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
499 |
+
*
|
500 |
+
* @param $expected
|
501 |
+
* @param $actual
|
502 |
+
* @param $description
|
503 |
+
* @see \Codeception\Module\Asserts::assertLessOrEquals()
|
504 |
+
*/
|
505 |
+
public function assertLessOrEquals($expected, $actual, $description = null) {
|
506 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args()));
|
507 |
+
}
|
508 |
+
|
509 |
+
|
510 |
+
/**
|
511 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
512 |
+
*
|
513 |
+
* @param $actual
|
514 |
+
* @param $description
|
515 |
+
* @see \Codeception\Module\Asserts::assertIsEmpty()
|
516 |
+
*/
|
517 |
+
public function assertIsEmpty($actual, $description = null) {
|
518 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args()));
|
519 |
+
}
|
520 |
+
|
521 |
+
|
522 |
+
/**
|
523 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
524 |
+
*
|
525 |
+
* @param $key
|
526 |
+
* @param $actual
|
527 |
+
* @param $description
|
528 |
+
* @see \Codeception\Module\Asserts::assertArrayHasKey()
|
529 |
+
*/
|
530 |
+
public function assertArrayHasKey($key, $actual, $description = null) {
|
531 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args()));
|
532 |
+
}
|
533 |
+
|
534 |
+
|
535 |
+
/**
|
536 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
537 |
+
*
|
538 |
+
* @param $key
|
539 |
+
* @param $actual
|
540 |
+
* @param $description
|
541 |
+
* @see \Codeception\Module\Asserts::assertArrayNotHasKey()
|
542 |
+
*/
|
543 |
+
public function assertArrayNotHasKey($key, $actual, $description = null) {
|
544 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args()));
|
545 |
+
}
|
546 |
+
|
547 |
+
|
548 |
+
/**
|
549 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
550 |
+
*
|
551 |
+
* @param $expectedCount
|
552 |
+
* @param $actual
|
553 |
+
* @param $description
|
554 |
+
* @see \Codeception\Module\Asserts::assertCount()
|
555 |
+
*/
|
556 |
+
public function assertCount($expectedCount, $actual, $description = null) {
|
557 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args()));
|
558 |
+
}
|
559 |
+
|
560 |
+
|
561 |
+
/**
|
562 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
563 |
+
*
|
564 |
+
* @param $class
|
565 |
+
* @param $actual
|
566 |
+
* @param $description
|
567 |
+
* @see \Codeception\Module\Asserts::assertInstanceOf()
|
568 |
+
*/
|
569 |
+
public function assertInstanceOf($class, $actual, $description = null) {
|
570 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args()));
|
571 |
+
}
|
572 |
+
|
573 |
+
|
574 |
+
/**
|
575 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
576 |
+
*
|
577 |
+
* @param $class
|
578 |
+
* @param $actual
|
579 |
+
* @param $description
|
580 |
+
* @see \Codeception\Module\Asserts::assertNotInstanceOf()
|
581 |
+
*/
|
582 |
+
public function assertNotInstanceOf($class, $actual, $description = null) {
|
583 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args()));
|
584 |
+
}
|
585 |
+
|
586 |
+
|
587 |
+
/**
|
588 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
589 |
+
*
|
590 |
+
* @param $type
|
591 |
+
* @param $actual
|
592 |
+
* @param $description
|
593 |
+
* @see \Codeception\Module\Asserts::assertInternalType()
|
594 |
+
*/
|
595 |
+
public function assertInternalType($type, $actual, $description = null) {
|
596 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args()));
|
597 |
+
}
|
598 |
+
|
599 |
+
|
600 |
+
/**
|
601 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
602 |
+
*
|
603 |
+
* Fails the test with message.
|
604 |
+
*
|
605 |
+
* @param $message
|
606 |
+
* @see \Codeception\Module\Asserts::fail()
|
607 |
+
*/
|
608 |
+
public function fail($message) {
|
609 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args()));
|
610 |
+
}
|
611 |
+
|
612 |
+
|
613 |
+
/**
|
614 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
615 |
+
*
|
616 |
+
*
|
617 |
+
* @see \Codeception\Module\Asserts::assertStringContainsString()
|
618 |
+
*/
|
619 |
+
public function assertStringContainsString($needle, $haystack, $message = null) {
|
620 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsString', func_get_args()));
|
621 |
+
}
|
622 |
+
|
623 |
+
|
624 |
+
/**
|
625 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
626 |
+
*
|
627 |
+
*
|
628 |
+
* @see \Codeception\Module\Asserts::assertStringNotContainsString()
|
629 |
+
*/
|
630 |
+
public function assertStringNotContainsString($needle, $haystack, $message = null) {
|
631 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsString', func_get_args()));
|
632 |
+
}
|
633 |
+
|
634 |
+
|
635 |
+
/**
|
636 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
637 |
+
*
|
638 |
+
*
|
639 |
+
* @see \Codeception\Module\Asserts::assertStringContainsStringIgnoringCase()
|
640 |
+
*/
|
641 |
+
public function assertStringContainsStringIgnoringCase($needle, $haystack, $message = null) {
|
642 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsStringIgnoringCase', func_get_args()));
|
643 |
+
}
|
644 |
+
|
645 |
+
|
646 |
+
/**
|
647 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
648 |
+
*
|
649 |
+
*
|
650 |
+
* @see \Codeception\Module\Asserts::assertStringNotContainsStringIgnoringCase()
|
651 |
+
*/
|
652 |
+
public function assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = null) {
|
653 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsStringIgnoringCase', func_get_args()));
|
654 |
+
}
|
655 |
+
|
656 |
+
|
657 |
+
/**
|
658 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
659 |
+
*
|
660 |
+
* @since 1.1.0 of module-asserts
|
661 |
+
* @see \Codeception\Module\Asserts::assertStringEndsWith()
|
662 |
+
*/
|
663 |
+
public function assertStringEndsWith($suffix, $string, $message = null) {
|
664 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsWith', func_get_args()));
|
665 |
+
}
|
666 |
+
|
667 |
+
|
668 |
+
/**
|
669 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
670 |
+
*
|
671 |
+
* @since 1.1.0 of module-asserts
|
672 |
+
* @see \Codeception\Module\Asserts::assertStringEndsNotWith()
|
673 |
+
*/
|
674 |
+
public function assertStringEndsNotWith($suffix, $string, $message = null) {
|
675 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsNotWith', func_get_args()));
|
676 |
+
}
|
677 |
+
|
678 |
+
|
679 |
+
/**
|
680 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
681 |
+
*
|
682 |
+
*
|
683 |
+
* @see \Codeception\Module\Asserts::assertIsArray()
|
684 |
+
*/
|
685 |
+
public function assertIsArray($actual, $message = null) {
|
686 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsArray', func_get_args()));
|
687 |
+
}
|
688 |
+
|
689 |
+
|
690 |
+
/**
|
691 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
692 |
+
*
|
693 |
+
*
|
694 |
+
* @see \Codeception\Module\Asserts::assertIsBool()
|
695 |
+
*/
|
696 |
+
public function assertIsBool($actual, $message = null) {
|
697 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsBool', func_get_args()));
|
698 |
+
}
|
699 |
+
|
700 |
+
|
701 |
+
/**
|
702 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
703 |
+
*
|
704 |
+
*
|
705 |
+
* @see \Codeception\Module\Asserts::assertIsFloat()
|
706 |
+
*/
|
707 |
+
public function assertIsFloat($actual, $message = null) {
|
708 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsFloat', func_get_args()));
|
709 |
+
}
|
710 |
+
|
711 |
+
|
712 |
+
/**
|
713 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
714 |
+
*
|
715 |
+
*
|
716 |
+
* @see \Codeception\Module\Asserts::assertIsInt()
|
717 |
+
*/
|
718 |
+
public function assertIsInt($actual, $message = null) {
|
719 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsInt', func_get_args()));
|
720 |
+
}
|
721 |
+
|
722 |
+
|
723 |
+
/**
|
724 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
725 |
+
*
|
726 |
+
*
|
727 |
+
* @see \Codeception\Module\Asserts::assertIsNumeric()
|
728 |
+
*/
|
729 |
+
public function assertIsNumeric($actual, $message = null) {
|
730 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNumeric', func_get_args()));
|
731 |
+
}
|
732 |
+
|
733 |
+
|
734 |
+
/**
|
735 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
736 |
+
*
|
737 |
+
*
|
738 |
+
* @see \Codeception\Module\Asserts::assertIsObject()
|
739 |
+
*/
|
740 |
+
public function assertIsObject($actual, $message = null) {
|
741 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsObject', func_get_args()));
|
742 |
+
}
|
743 |
+
|
744 |
+
|
745 |
+
/**
|
746 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
747 |
+
*
|
748 |
+
*
|
749 |
+
* @see \Codeception\Module\Asserts::assertIsResource()
|
750 |
+
*/
|
751 |
+
public function assertIsResource($actual, $message = null) {
|
752 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsResource', func_get_args()));
|
753 |
+
}
|
754 |
+
|
755 |
+
|
756 |
+
/**
|
757 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
758 |
+
*
|
759 |
+
*
|
760 |
+
* @see \Codeception\Module\Asserts::assertIsString()
|
761 |
+
*/
|
762 |
+
public function assertIsString($actual, $message = null) {
|
763 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsString', func_get_args()));
|
764 |
+
}
|
765 |
+
|
766 |
+
|
767 |
+
/**
|
768 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
769 |
+
*
|
770 |
+
*
|
771 |
+
* @see \Codeception\Module\Asserts::assertIsScalar()
|
772 |
+
*/
|
773 |
+
public function assertIsScalar($actual, $message = null) {
|
774 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsScalar', func_get_args()));
|
775 |
+
}
|
776 |
+
|
777 |
+
|
778 |
+
/**
|
779 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
780 |
+
*
|
781 |
+
*
|
782 |
+
* @see \Codeception\Module\Asserts::assertIsCallable()
|
783 |
+
*/
|
784 |
+
public function assertIsCallable($actual, $message = null) {
|
785 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsCallable', func_get_args()));
|
786 |
+
}
|
787 |
+
|
788 |
+
|
789 |
+
/**
|
790 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
791 |
+
*
|
792 |
+
*
|
793 |
+
* @see \Codeception\Module\Asserts::assertIsNotArray()
|
794 |
+
*/
|
795 |
+
public function assertIsNotArray($actual, $message = null) {
|
796 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotArray', func_get_args()));
|
797 |
+
}
|
798 |
+
|
799 |
+
|
800 |
+
/**
|
801 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
802 |
+
*
|
803 |
+
*
|
804 |
+
* @see \Codeception\Module\Asserts::assertIsNotBool()
|
805 |
+
*/
|
806 |
+
public function assertIsNotBool($actual, $message = null) {
|
807 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotBool', func_get_args()));
|
808 |
+
}
|
809 |
+
|
810 |
+
|
811 |
+
/**
|
812 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
813 |
+
*
|
814 |
+
*
|
815 |
+
* @see \Codeception\Module\Asserts::assertIsNotFloat()
|
816 |
+
*/
|
817 |
+
public function assertIsNotFloat($actual, $message = null) {
|
818 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotFloat', func_get_args()));
|
819 |
+
}
|
820 |
+
|
821 |
+
|
822 |
+
/**
|
823 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
824 |
+
*
|
825 |
+
*
|
826 |
+
* @see \Codeception\Module\Asserts::assertIsNotInt()
|
827 |
+
*/
|
828 |
+
public function assertIsNotInt($actual, $message = null) {
|
829 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotInt', func_get_args()));
|
830 |
+
}
|
831 |
+
|
832 |
+
|
833 |
+
/**
|
834 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
835 |
+
*
|
836 |
+
*
|
837 |
+
* @see \Codeception\Module\Asserts::assertIsNotNumeric()
|
838 |
+
*/
|
839 |
+
public function assertIsNotNumeric($actual, $message = null) {
|
840 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotNumeric', func_get_args()));
|
841 |
+
}
|
842 |
+
|
843 |
+
|
844 |
+
/**
|
845 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
846 |
+
*
|
847 |
+
*
|
848 |
+
* @see \Codeception\Module\Asserts::assertIsNotObject()
|
849 |
+
*/
|
850 |
+
public function assertIsNotObject($actual, $message = null) {
|
851 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotObject', func_get_args()));
|
852 |
+
}
|
853 |
+
|
854 |
+
|
855 |
+
/**
|
856 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
857 |
+
*
|
858 |
+
*
|
859 |
+
* @see \Codeception\Module\Asserts::assertIsNotResource()
|
860 |
+
*/
|
861 |
+
public function assertIsNotResource($actual, $message = null) {
|
862 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotResource', func_get_args()));
|
863 |
+
}
|
864 |
+
|
865 |
+
|
866 |
+
/**
|
867 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
868 |
+
*
|
869 |
+
*
|
870 |
+
* @see \Codeception\Module\Asserts::assertIsNotString()
|
871 |
+
*/
|
872 |
+
public function assertIsNotString($actual, $message = null) {
|
873 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotString', func_get_args()));
|
874 |
+
}
|
875 |
+
|
876 |
+
|
877 |
+
/**
|
878 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
879 |
+
*
|
880 |
+
*
|
881 |
+
* @see \Codeception\Module\Asserts::assertIsNotScalar()
|
882 |
+
*/
|
883 |
+
public function assertIsNotScalar($actual, $message = null) {
|
884 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotScalar', func_get_args()));
|
885 |
+
}
|
886 |
+
|
887 |
+
|
888 |
+
/**
|
889 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
890 |
+
*
|
891 |
+
*
|
892 |
+
* @see \Codeception\Module\Asserts::assertIsNotCallable()
|
893 |
+
*/
|
894 |
+
public function assertIsNotCallable($actual, $message = null) {
|
895 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotCallable', func_get_args()));
|
896 |
+
}
|
897 |
+
|
898 |
+
|
899 |
+
/**
|
900 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
901 |
+
*
|
902 |
+
*
|
903 |
+
* @see \Codeception\Module\Asserts::assertEqualsCanonicalizing()
|
904 |
+
*/
|
905 |
+
public function assertEqualsCanonicalizing($expected, $actual, $message = null) {
|
906 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsCanonicalizing', func_get_args()));
|
907 |
+
}
|
908 |
+
|
909 |
+
|
910 |
+
/**
|
911 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
912 |
+
*
|
913 |
+
*
|
914 |
+
* @see \Codeception\Module\Asserts::assertNotEqualsCanonicalizing()
|
915 |
+
*/
|
916 |
+
public function assertNotEqualsCanonicalizing($expected, $actual, $message = null) {
|
917 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsCanonicalizing', func_get_args()));
|
918 |
+
}
|
919 |
+
|
920 |
+
|
921 |
+
/**
|
922 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
923 |
+
*
|
924 |
+
*
|
925 |
+
* @see \Codeception\Module\Asserts::assertEqualsIgnoringCase()
|
926 |
+
*/
|
927 |
+
public function assertEqualsIgnoringCase($expected, $actual, $message = null) {
|
928 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsIgnoringCase', func_get_args()));
|
929 |
+
}
|
930 |
+
|
931 |
+
|
932 |
+
/**
|
933 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
934 |
+
*
|
935 |
+
*
|
936 |
+
* @see \Codeception\Module\Asserts::assertNotEqualsIgnoringCase()
|
937 |
+
*/
|
938 |
+
public function assertNotEqualsIgnoringCase($expected, $actual, $message = null) {
|
939 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsIgnoringCase', func_get_args()));
|
940 |
+
}
|
941 |
+
|
942 |
+
|
943 |
+
/**
|
944 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
945 |
+
*
|
946 |
+
*
|
947 |
+
* @see \Codeception\Module\Asserts::assertEqualsWithDelta()
|
948 |
+
*/
|
949 |
+
public function assertEqualsWithDelta($expected, $actual, $delta, $message = null) {
|
950 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsWithDelta', func_get_args()));
|
951 |
+
}
|
952 |
+
|
953 |
+
|
954 |
+
/**
|
955 |
+
* [!] Method is generated. Documentation taken from corresponding module.
|
956 |
+
*
|
957 |
+
*
|
958 |
+
* @see \Codeception\Module\Asserts::assertNotEqualsWithDelta()
|
959 |
+
*/
|
960 |
+
public function assertNotEqualsWithDelta($expected, $actual, $delta, $message = null) {
|
961 |
+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsWithDelta', func_get_args()));
|
962 |
+
}
|
963 |
+
}
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //[STAMP] e72bdc7d61b1e8b2779445e4eae8f800
|
2 |
+
namespace _generated;
|
3 |
+
|
4 |
+
// This class was automatically generated by build task
|
5 |
+
// You should not change it manually as it will be overwritten on next build
|
6 |
+
// @codingStandardsIgnoreFile
|
7 |
+
|
8 |
+
trait WpunitTesterActions
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* @return \Codeception\Scenario
|
12 |
+
*/
|
13 |
+
abstract protected function getScenario();
|
14 |
+
|
15 |
+
|
16 |
+
}
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Codeception Test Suite Configuration
|
2 |
+
#
|
3 |
+
# Suite for acceptance tests.
|
4 |
+
# Perform tests in browser using the WPWebDriver or WPBrowser.
|
5 |
+
# Use WPDb to set up your initial database fixture.
|
6 |
+
# If you need both WPWebDriver and WPBrowser tests - create a separate suite.
|
7 |
+
|
8 |
+
actor: AcceptanceTester
|
9 |
+
modules:
|
10 |
+
enabled:
|
11 |
+
# - WPDb
|
12 |
+
# - WPBrowser
|
13 |
+
- WPWebDriver
|
14 |
+
- \Helper\Acceptance
|
15 |
+
config:
|
16 |
+
# WPWebDriver:
|
17 |
+
# url: '%TEST_SITE_WP_URL%'
|
18 |
+
# adminUsername: '%TEST_SITE_ADMIN_USERNAME%'
|
19 |
+
# adminPassword: '%TEST_SITE_ADMIN_PASSWORD%'
|
20 |
+
# adminPath: '%TEST_SITE_WP_ADMIN_PATH%'
|
21 |
+
# browser: chrome
|
22 |
+
# host: localhost
|
23 |
+
# port: 4444
|
24 |
+
# window_size: false #disabled for Chrome driver
|
25 |
+
# log_js_errors: true
|
26 |
+
# capabilities:
|
27 |
+
# chromeOptions:
|
28 |
+
# args: ["--headless", "--disable-gpu", "--proxy-server='direct://'", "--proxy-bypass-list=*", "--ignore-certificate-errors", "--disable-web-security", "--ignore-urlfetcher-cert-requests"]
|
29 |
+
WPWebDriver:
|
30 |
+
url: '%TEST_SITE_WP_URL%'
|
31 |
+
adminUsername: '%TEST_SITE_ADMIN_USERNAME%'
|
32 |
+
adminPassword: '%TEST_SITE_ADMIN_PASSWORD%'
|
33 |
+
adminPath: '%TEST_SITE_WP_ADMIN_PATH%'
|
34 |
+
browser: chrome
|
35 |
+
host: '%TESTING_HOST%'
|
36 |
+
port: '%TESTING_PORT%'
|
37 |
+
window_size: false #disabled for Chrome driver
|
38 |
+
log_js_errors: true
|
39 |
+
capabilities:
|
40 |
+
os: Windows
|
41 |
+
os_version: 10
|
42 |
+
chromeOptions:
|
43 |
+
args: ["%TESTING_HEADLESS%", "--disable-gpu", "--proxy-server='direct://'", "--proxy-bypass-list=*", "--ignore-certificate-errors", "--disable-web-security", "--ignore-urlfetcher-cert-requests"]
|
44 |
+
WPDb:
|
45 |
+
dsn: '%TEST_SITE_DB_DSN%'
|
46 |
+
user: '%TEST_SITE_DB_USER%'
|
47 |
+
password: '%TEST_SITE_DB_PASSWORD%'
|
48 |
+
dump: 'tests/_data/dump.sql'
|
49 |
+
#import the dump before the tests; this means the test site database will be repopulated before the tests.
|
50 |
+
populate: true
|
51 |
+
# re-import the dump between tests; this means the test site database will be repopulated between the tests.
|
52 |
+
cleanup: true
|
53 |
+
waitlock: 10
|
54 |
+
url: '%TEST_SITE_WP_URL%'
|
55 |
+
urlReplacement: true #replace the hardcoded dump URL with the one above
|
56 |
+
tablePrefix: '%TEST_SITE_TABLE_PREFIX%'
|
57 |
+
WPBrowser:
|
58 |
+
url: '%TEST_SITE_WP_URL%'
|
59 |
+
adminUsername: '%TEST_SITE_ADMIN_USERNAME%'
|
60 |
+
adminPassword: '%TEST_SITE_ADMIN_PASSWORD%'
|
61 |
+
adminPath: '%TEST_SITE_WP_ADMIN_PATH%'
|
62 |
+
headers:
|
63 |
+
X_TEST_REQUEST: 1
|
64 |
+
X_WPBROWSER_REQUEST: 1
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use Codeception\Util\Locator;
|
4 |
+
|
5 |
+
|
6 |
+
class InstallPluginCest
|
7 |
+
{
|
8 |
+
public function _before(AcceptanceTester $I)
|
9 |
+
{
|
10 |
+
|
11 |
+
}
|
12 |
+
|
13 |
+
public function _loginAndActivate(AcceptanceTester $I) {
|
14 |
+
$I->loginAsAdmin();
|
15 |
+
$I->amOnPluginsPage();
|
16 |
+
$I->amGoingTo('Check if plugin is activated');
|
17 |
+
if ($I->seePluginActivated('quiz-master-next')) {
|
18 |
+
$I->activatePlugin('quiz-master-next');
|
19 |
+
$I->see(' activated.'); //bulk activation also taken care of.
|
20 |
+
}
|
21 |
+
$I->amOnPage('/wp-admin/admin.php?page=quiz-master-next%2Fmlw_quizmaster2.php');
|
22 |
+
}
|
23 |
+
|
24 |
+
public function _createNewQuiz(AcceptanceTester $I) {
|
25 |
+
$quiz_name = 'Test Quiz - ' . uniqid();
|
26 |
+
|
27 |
+
$I->click(['id' => 'new_quiz_button']);
|
28 |
+
$I->fillField('quiz_name', $quiz_name);
|
29 |
+
$I->wait(1);
|
30 |
+
$I->click('button[id="create-quiz-button"]');
|
31 |
+
$I->see($quiz_name);
|
32 |
+
$quiz_slug = strtolower($quiz_name);
|
33 |
+
$quiz_slug = str_replace(" ", "-", $quiz_slug);
|
34 |
+
|
35 |
+
return [$quiz_name, $quiz_slug];
|
36 |
+
}
|
37 |
+
|
38 |
+
public function _createQuestion(AcceptanceTester $I) {
|
39 |
+
$I->amGoingTo('Click on the New Page button');
|
40 |
+
$I->click('button[class="new-page-button button"]');
|
41 |
+
$I->waitForText('Create New Question', 3);
|
42 |
+
|
43 |
+
|
44 |
+
$I->amGoingTo('create new question and save it');
|
45 |
+
$I->click('Create New Question');
|
46 |
+
$I->wait(1);
|
47 |
+
}
|
48 |
+
|
49 |
+
public function _addNewMultiChoiceAnswer(AcceptanceTester $I, $count = 4) {
|
50 |
+
$faker = Faker\Factory::create();
|
51 |
+
$answers = [];
|
52 |
+
|
53 |
+
$I->amGoingTo('Add new answer');
|
54 |
+
|
55 |
+
for ($i=1; $i <= $count; $i++) {
|
56 |
+
$I->click('Add New Answer!');
|
57 |
+
$answer = $faker->sentence($nbWords = 6, $variableNbWords = true);
|
58 |
+
$I->fillField(Locator::elementAt("//input[@class='answer-text']", $i), $answer);
|
59 |
+
$answers[] = $answer;
|
60 |
+
}
|
61 |
+
|
62 |
+
$I->checkOption(Locator::elementAt("//input[@class='answer-correct']", 1));
|
63 |
+
return $answers;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function _saveQuestion(AcceptanceTester $I)
|
67 |
+
{
|
68 |
+
$I->click('button[id="save-popup-button"]');
|
69 |
+
$I->wait(1);
|
70 |
+
$I->dontSeeElement('#save-popup-button');
|
71 |
+
}
|
72 |
+
|
73 |
+
public function _loadQuiz(AcceptanceTester $I, $quiz_slug) {
|
74 |
+
$I->amOnPage('/quiz/' . $quiz_slug);
|
75 |
+
|
76 |
+
$I->amGoingTo('Check if quiz was loaded properly');
|
77 |
+
$I->waitForText('Your new question!', 3);
|
78 |
+
}
|
79 |
+
|
80 |
+
public function _submitQuiz(AcceptanceTester $I, $answers)
|
81 |
+
{
|
82 |
+
|
83 |
+
$I->amGoingTo("Select the first answer");
|
84 |
+
$I->waitForJqueryAjax();
|
85 |
+
$I->scrollTo(['css' => '.qmn_quiz_radio'], 0, -40);
|
86 |
+
// $option = $I->grabTextFrom("//input[@class='qmn_quiz_radio']");
|
87 |
+
// $I->executeJS('console.log('.$option.')');
|
88 |
+
// $I->amGoingTo($option);
|
89 |
+
// $I->waitForText($answers[0]);
|
90 |
+
$I->see($answers[0]);
|
91 |
+
$I->waitForElementClickable(Locator::elementAt("//input[@class='qmn_quiz_radio']", 1), 3);
|
92 |
+
$I->wait(1);
|
93 |
+
$I->selectOption("//input[@class='qmn_quiz_radio']", $answers[0]);
|
94 |
+
// $I->wait(3);
|
95 |
+
$I->click('Submit');
|
96 |
+
$I->waitForJqueryAjax();
|
97 |
+
$I->see('Answer Provided: '. $answers[0]);
|
98 |
+
$I->see('Correct Answer: ' . $answers[0]);
|
99 |
+
// $I->wait(3);
|
100 |
+
}
|
101 |
+
|
102 |
+
// tests
|
103 |
+
public function testProgressBarQuiz(AcceptanceTester $I)
|
104 |
+
{
|
105 |
+
|
106 |
+
$this->_loginAndActivate($I);
|
107 |
+
[$quiz_name, $quiz_slug] = $this->_createNewQuiz($I);
|
108 |
+
$this->_createQuestion($I);
|
109 |
+
$answers = $this->_addNewMultiChoiceAnswer($I, 4);
|
110 |
+
$this->_saveQuestion($I);
|
111 |
+
|
112 |
+
$I->click('Options');
|
113 |
+
// $I->wait(1);
|
114 |
+
$I->click('label[for="progress_bar-1"]');
|
115 |
+
$I->click('//*[@id="wpbody-content"]/div[2]/div[1]/div[2]/form/button[1]');
|
116 |
+
|
117 |
+
// $quiz_slug = "test-quiz-5ec64739d8a52";
|
118 |
+
// $answers = ["Aut fuga error aut occaecati eveniet et ex."];
|
119 |
+
$this->_loadQuiz($I, $quiz_slug);
|
120 |
+
$this->_submitQuiz($I, $answers);
|
121 |
+
|
122 |
+
}
|
123 |
+
|
124 |
+
|
125 |
+
}
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Codeception Test Suite Configuration
|
2 |
+
#
|
3 |
+
# Suite for functional tests
|
4 |
+
# Emulate web requests and make WordPress process them
|
5 |
+
|
6 |
+
actor: FunctionalTester
|
7 |
+
modules:
|
8 |
+
enabled:
|
9 |
+
# - WPDb
|
10 |
+
# - WPBrowser
|
11 |
+
# - WPFilesystem
|
12 |
+
- Asserts
|
13 |
+
- \Helper\Functional
|
14 |
+
config:
|
15 |
+
WPDb:
|
16 |
+
dsn: '%TEST_SITE_DB_DSN%'
|
17 |
+
user: '%TEST_SITE_DB_USER%'
|
18 |
+
password: '%TEST_SITE_DB_PASSWORD%'
|
19 |
+
dump: 'tests/_data/dump.sql'
|
20 |
+
populate: true
|
21 |
+
cleanup: true
|
22 |
+
waitlock: 10
|
23 |
+
url: '%TEST_SITE_WP_URL%'
|
24 |
+
urlReplacement: true
|
25 |
+
tablePrefix: '%TEST_SITE_TABLE_PREFIX%'
|
26 |
+
WPBrowser:
|
27 |
+
url: '%TEST_SITE_WP_URL%'
|
28 |
+
adminUsername: '%TEST_SITE_ADMIN_USERNAME%'
|
29 |
+
adminPassword: '%TEST_SITE_ADMIN_PASSWORD%'
|
30 |
+
adminPath: '%TEST_SITE_WP_ADMIN_PATH%'
|
31 |
+
headers:
|
32 |
+
X_TEST_REQUEST: 1
|
33 |
+
X_WPBROWSER_REQUEST: 1
|
34 |
+
|
35 |
+
WPFilesystem:
|
36 |
+
wpRootFolder: '%WP_ROOT_FOLDER%'
|
37 |
+
plugins: '/wp-content/plugins'
|
38 |
+
mu-plugins: '/wp-content/mu-plugins'
|
39 |
+
themes: '/wp-content/themes'
|
40 |
+
uploads: '/wp-content/uploads'
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Codeception Test Suite Configuration
|
2 |
+
#
|
3 |
+
# Suite for unit or integration tests.
|
4 |
+
|
5 |
+
actor: UnitTester
|
6 |
+
modules:
|
7 |
+
enabled:
|
8 |
+
- Asserts
|
9 |
+
- \Helper\Unit
|
10 |
+
step_decorators: ~
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Codeception Test Suite Configuration
|
2 |
+
#
|
3 |
+
# Suite for unit or integration tests that require WordPress functions and classes.
|
4 |
+
|
5 |
+
actor: WpunitTester
|
6 |
+
modules:
|
7 |
+
enabled:
|
8 |
+
# - WPLoader
|
9 |
+
- \Helper\Wpunit
|
10 |
+
config:
|
11 |
+
WPLoader:
|
12 |
+
wpRootFolder: "%WP_ROOT_FOLDER%"
|
13 |
+
dbName: "%TEST_DB_NAME%"
|
14 |
+
dbHost: "%TEST_DB_HOST%"
|
15 |
+
dbUser: "%TEST_DB_USER%"
|
16 |
+
dbPassword: "%TEST_DB_PASSWORD%"
|
17 |
+
tablePrefix: "%TEST_TABLE_PREFIX%"
|
18 |
+
domain: "%TEST_SITE_WP_DOMAIN%"
|
19 |
+
adminEmail: "%TEST_SITE_ADMIN_EMAIL%"
|
20 |
+
title: "WP Test"
|
21 |
+
plugins: ['']
|
22 |
+
activatePlugins: ['']
|