From 484986946da53f1b6dc8d1106b31f82d42d2a42b Mon Sep 17 00:00:00 2001 From: Olle Haerstedt Date: Mon, 30 Oct 2017 16:50:51 +0100 Subject: [PATCH] Dev: Remove unused code --- tests/questions/DateTimeValidationTest.php | 131 +-------------------- 1 file changed, 2 insertions(+), 129 deletions(-) diff --git a/tests/questions/DateTimeValidationTest.php b/tests/questions/DateTimeValidationTest.php index 1b787cf6799..cfae37be6d5 100644 --- a/tests/questions/DateTimeValidationTest.php +++ b/tests/questions/DateTimeValidationTest.php @@ -63,19 +63,6 @@ public function setUp() $capabilities = DesiredCapabilities::firefox(); $this->webDriver = RemoteWebDriver::create('http://localhost:4444/wd/hub', $capabilities); - - /* - $this->setHost('localhost'); - $this->setPort(4444); - $this->setBrowserUrl( - sprintf( - 'http://localhost/%s/index.php/%d?newtest=Y&lang=pt', - getenv('URL'), - self::$surveyId - ) - ); - $this->setBrowser('firefox'); - */ } /** @@ -105,117 +92,11 @@ public function tearDown() $this->webDriver->quit(); } - /** - * "currentQset" in EM. - */ - protected function getQuestionSetForQ2(\Question $question, \QuestionGroup $group, $sgqa) - { - $qset = array($question->qid => array - ( - 'info' => array - ( - 'relevance' => '1', - 'grelevance' => '', - 'qid' => $question->qid, - 'qseq' => 1, - 'gseq' => 0, - 'jsResultVar_on' => 'answer' . $sgqa, - 'jsResultVar' => 'java' . $sgqa, - 'type' => $question->type, - 'hidden' => false, - 'gid' => $group->gid, - 'mandatory' => $question->mandatory, - 'eqn' => '', - 'help' => '', - 'qtext' => '', - 'code' => $question->title, - 'other' => 'N', - 'default' => null, - 'rootVarName' => $question->title, - 'rowdivid' => '', - 'aid' => '', - 'sqid' => '', - ), - 'relevant' => true, - 'hidden' => false, - 'relEqn' => '', - 'sgqa' => $sgqa, - 'unansweredSQs' => $sgqa, - 'valid' => true, - 'validEqn' => '', - 'prettyValidEqn' => '', - 'validTip' => '', - 'prettyValidTip' => '', - 'validJS' => '', - 'invalidSQs' => '', - 'relevantSQs' => $sgqa, - 'irrelevantSQs' => '', - 'subQrelEqn' => '', - 'mandViolation' => false, - 'anyUnanswered' => true, - 'mandTip' => '', - 'message' => '', - 'updatedValues' => array(), - 'sumEqn' => '', - 'sumRemainingEqn' => '' - ) - ); - return $qset; - } - /** * */ public function testBasic() { - /* - list($question, $group, $sgqa) = self::$testHelper->getSgqa('G1Q00005', self::$surveyId); - - $qset = $this->getQuestionSetForQ2($question, $group, $sgqa); - - $em = \LimeExpressionManager::singleton(); - $em->setCurrentQset($qset); - - $surveyMode = 'group'; - $LEMdebugLevel = 0; - $surveyOptions = self::$testHelper->getSurveyOptions(self::$surveyId); - \LimeExpressionManager::StartSurvey( - self::$surveyId, - $surveyMode, - $surveyOptions, - false, - $LEMdebugLevel - ); - - $qid = $question->qid; - $gseq = 0; - $_POST['relevance' . $qid] = 1; - $_POST['relevanceG' . $gseq] = 1; - $_POST[$sgqa] = '27/10/2017'; - - //$moveResult = \LimeExpressionManager::NavigateForwards(); - $result = \LimeExpressionManager::ProcessCurrentResponses(); - echo '
'; var_dump($_SESSION); echo '
'; - */ - - /* - \Yii::app()->setController(new DummyController('dummyid')); - - \Yii::app()->setConfig('surveyID', self::$surveyId); - global $thissurvey; - $thissurvey = getSurveyInfo(self::$surveyId); - - $runtime = new \SurveyRuntimeHelper(); - $runtime->run( - self::$surveyId, - [ - 'surveyid' => self::$surveyId, - 'thissurvey' => $thissurvey, - 'param' => [] - ] - ); - */ - $this->webDriver->get('http://localhost/lime25/limesurvey/index.php/118355?newtest=Y&lang=pt'); $submit = $this->webDriver->findElement(\Facebook\WebDriver\WebDriverBy::id('ls-button-submit')); $this->assertNotEmpty($submit); @@ -223,20 +104,12 @@ public function testBasic() WebDriverExpectedCondition::visibilityOf($submit) ); $submit->click(); + + // After submit we should see the complete page. $div = $this->webDriver->findElement(\Facebook\WebDriver\WebDriverBy::className('completed-text')); $this->assertNotEmpty($div); $this->webDriver->wait(10, 1000)->until( WebDriverExpectedCondition::visibilityOf($div) ); - - /* - $this->url('/'); - $content = $this->byTag('body')->text(); - //$this->byId('limesurvey')->submit(); - $move = $this->byId('ls-button-submit'); - $move->click(null); - $content = $this->byTag('body')->text(); - var_dump($content); - */ } }