def test_resourceAccessingViaPerssistentUrl(self):
     resourcesPage = ResourcesPagesCMS(self.driver, self.wait)
     resourcesPage.search_in_searchbar("The Israeli Palestinian Conflict")
     resourcesPage.clickOnLink("The Israeli Palestinian Conflict")
     res = EditAddResourcePageCMS(self.driver, self.wait)
     code = res.getResourceCode()
     slug = res.getResourceSlug()
     title = res.getTitle()
     resView = ResourceViewPageSS(self.driver, self.wait, "%s/%s" %(code, slug))
     self.assertEquals(resView.getTitle(), title, "Perssistent url didn't open the correct resource in audience facing site")
 def test_addSupportMaterials(self):
     editResourcePage = self.openResource()
     editResourcePage.clickShowSupportMaterialsLink()
     htmlFragment = editResourcePage.clickAddBackgroundEssayButton()
     htmlFragment.typeInNameField(self.resource)
     htmlFragment.typeInContentFields(self.resource)
     htmlFragment.selectFragmentType("Background Essay")
     htmlFragment.clickSave()
     htmlFragment.switchToNewestWindow()
     editResourcePage = EditAddResourcePageCMS(self.driver, self.wait)
     editResourcePage = editResourcePage.clickSaveAndContinueEditingButton()
     editResourcePage.clickShowSupportMaterialsLink()
     self.assertTrue(editResourcePage.isBackgroundEssayAttached(self.resource), "Support material not added!")
 def add_resource_with_title(self, title):
     self.driver.get(ServerRelated().serverToBeTested() + "/admin/cms/resource/add/")
     addResourcePage = EditAddResourcePageCMS(self.driver, self.wait)
     addResourcePage.typeTitle(title)
     addResourcePage.selectContentProjectByIndex(1)
     editResourcePage = addResourcePage.clickSaveButton()
     return editResourcePage