/** * @test */ public function setFilter_TestFilters_ShouldFilterTags() { $langName_1 = 'Test Filter 1'; $langName_2 = 'Test Filter 2'; $salt = rand(); $lang_title_native = 'Sample2' . $salt; $url_code = 'Sample2' . $salt; $image_prefix = 'af'; //Other than the Default Value $language_tag = 'Sample2'; $this->languageManagerPage = $this->getPageObject('LanguageManagerPage'); $this->languageManagerPage->addLanguage($langName_1); $message = $this->languageManagerPage->getAlertMessage(); $this->assertTrue(strpos($message, 'Content Language successfully saved') >= 0, 'Test Lang Save should return success'); $state = $this->languageManagerPage->getState($langName_1); $this->assertEquals('published', $state, 'Initial state should be published'); $this->languageManagerPage->addLanguage($langName_2, $lang_title_native, $url_code, $image_prefix, $language_tag); $message = $this->languageManagerPage->getAlertMessage(); $this->assertTrue(strpos($message, 'Content Language successfully saved') >= 0, 'Test Lang save should return success'); $state = $this->languageManagerPage->getState($langName_2); $this->assertEquals('published', $state, 'Initial state should be published'); $this->languageManagerPage->changeLanguageState($langName_2, 'unpublished'); $test = $this->languageManagerPage->setFilter('filter_published', 'Unpublished'); $this->assertFalse($this->languageManagerPage->getRowNumber($langName_1), 'Lang should not show'); $this->assertEquals(1, $this->languageManagerPage->getRowNumber($langName_2), 'Lang should be in row 1'); $test = $this->languageManagerPage->setFilter('filter_published', 'Published'); $this->assertFalse($this->languageManagerPage->getRowNumber($langName_2), 'Lang should not show'); $this->assertEquals(2, $this->languageManagerPage->getRowNumber($langName_1), 'Lang should be in row 2'); $this->languageManagerPage->setFilter('Select Status', 'Select Status'); $this->languageManagerPage->trashAndDelete($langName_1); $this->languageManagerPage->trashAndDelete($langName_2); }
/** * @test */ public function editLanguage_ChangeFields_FieldsChanged() { $salt = rand(); $langName = 'lang' . $salt; $new_lang_name = 'new_sample_Title'; $lang_title_native = 'Sample' . $salt; $url_code = 'Sample' . $salt; $image_prefix = 'us'; //Other than the Default Value $language_tag = 'Sample'; $this->languageManagerPage = $this->getPageObject('LanguageManagerPage'); $this->assertFalse($this->languageManagerPage->getRowNumber($langName), 'Test lang should not be present'); $this->languageManagerPage->addLanguage($langName, $lang_title_native, $url_code, $image_prefix, $language_tag); $message = $this->languageManagerPage->getAlertMessage(); $this->assertTrue(strpos($message, 'Content Language successfully saved') >= 0, 'Content Language save should return success'); $this->languageManagerPage->editLanguage($langName, array('Title' => 'new_sample_Title', 'Title Native' => 'Default')); $values = $this->languageManagerPage->getFieldValues('LanguageEditPage', $new_lang_name, array('Title', 'Title Native')); $this->assertEquals(array('new_sample_Title', 'Default'), $values, 'Actual values should match expected'); $this->languageManagerPage->trashAndDelete($new_lang_name); }