diff --git a/tests/data/surveys/limesurvey_survey_rankingFilterHideShow.lss b/tests/data/surveys/limesurvey_survey_rankingFilterHideShow.lss new file mode 100644 index 00000000000..d80c2440b02 --- /dev/null +++ b/tests/data/surveys/limesurvey_survey_rankingFilterHideShow.lss @@ -0,0 +1,496 @@ + + + Survey + 359 + + en + + + + qid + code + answer + sortorder + assessment_value + language + scale_id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gid + sid + group_name + group_order + description + language + randomization_group + grelevance + + + + + + + + + + + + + + + + + qid + parent_qid + sid + gid + type + title + question + preg + help + other + mandatory + question_order + language + scale_id + same_default + relevance + modulename + + + + + + + + + <![CDATA[FILTER]]> + + + + + + + + + + + + + + + + + + + <![CDATA[Rank]]> + + + + + + + + + + + + + + + + + + + <![CDATA[Multip]]> + + + + + + + + + + + + + + + + + qid + parent_qid + sid + gid + type + title + question + preg + help + other + mandatory + question_order + language + scale_id + same_default + relevance + modulename + + + + + + + + + <![CDATA[SQ01]]> + + + + + + + + + + + + + + + + + <![CDATA[SQ02]]> + + + + + + + + + + + + + + + + + <![CDATA[SQ03]]> + + + + + + + + + + + + + + + + + <![CDATA[SQ04]]> + + + + + + + + + + + + + + + + + <![CDATA[SQ01]]> + + + + + + + + + + + + + + + + + <![CDATA[SQ02]]> + + + + + + + + + + + + + + + + + <![CDATA[SQ03]]> + + + + + + + + + + + + + + + + + <![CDATA[SQ04]]> + + + + + + + + + + + + + + + qid + attribute + value + language + + + + + + + + + + + + + + + + + sid + gsid + admin + expires + startdate + adminemail + anonymized + faxto + format + savetimings + template + language + additional_languages + datestamp + usecookie + allowregister + allowsave + autonumber_start + autoredirect + allowprev + printanswers + ipaddr + refurl + showsurveypolicynotice + publicstatistics + publicgraphs + listpublic + htmlemail + sendconfirmation + tokenanswerspersistence + assessments + usecaptcha + usetokens + bounce_email + attributedescriptions + emailresponseto + emailnotificationto + tokenlength + showxquestions + showgroupinfo + shownoanswer + showqnumcode + bouncetime + bounceprocessing + bounceaccounttype + bounceaccounthost + bounceaccountpass + bounceaccountencryption + bounceaccountuser + showwelcome + showprogress + questionindex + navigationdelay + nokeyboard + alloweditaftercompletion + googleanalyticsstyle + googleanalyticsapikey + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + surveyls_survey_id + surveyls_language + surveyls_title + surveyls_description + surveyls_welcometext + surveyls_endtext + surveyls_policy_notice + surveyls_policy_error + surveyls_policy_notice_label + surveyls_url + surveyls_urldescription + surveyls_email_invite_subj + surveyls_email_invite + surveyls_email_remind_subj + surveyls_email_remind + surveyls_email_register_subj + surveyls_email_register + surveyls_email_confirm_subj + surveyls_email_confirm + surveyls_dateformat + surveyls_attributecaptions + email_admin_notification_subj + email_admin_notification + email_admin_responses_subj + email_admin_responses + surveyls_numberformat + attachments + + + + + + + + + + + + + + + + + diff --git a/tests/questions/RankingFilterHideShowTest.php b/tests/questions/RankingFilterHideShowTest.php new file mode 100644 index 00000000000..74dba4db4d5 --- /dev/null +++ b/tests/questions/RankingFilterHideShowTest.php @@ -0,0 +1,70 @@ +getSurveyUrl(); + + /** @var WebDriver */ + $web = self::$webDriver; + // Get questions. + $questionObjects = \Question::model()->findAll("sid = :sid AND parent_qid = 0",array(":sid"=>self::$surveyId)); + /** @var \Question[] */ + $questions = []; + foreach ($questionObjects as $q) { + $questions[$q->title] = $q; + } + try { + $web->get($url); // Open survey. + $web->next(); // Click next. + /* Check if ranking question is totally hidden */ + /** @var RemoteWebElement */ + $rankingQuestion = self::$webDriver->findElement(WebDriverBy::id('question'.$questions['Rank']->qid)); + $this->assertFalse($rankingQuestion->isDisplayed()); + /* Click on 1st multiple choice : this must show ranking question */ + $checkboxSgqa = self::$surveyId . 'X' . $questions['FILTER']->gid . 'X' .$questions['FILTER']->qid . 'SQ01'; + $labelCheckbox = self::$webDriver->findElement( + WebDriverBy::cssSelector( + sprintf( + 'label[for="%s"]', + 'answer' . $checkboxSgqa + ) + ) + ); + $labelCheckbox->click(); + $this->assertTrue($rankingQuestion->isDisplayed()); + } catch (\Exception $ex) { + self::$testHelper->takeScreenshot(self::$webDriver, __CLASS__ . '_' . __FUNCTION__); + $this->assertFalse( + true, + self::$testHelper->javaTrace($ex) + ); + } + } +}