def test_add_pointer_asset(self): addAssetPage = AddEditAssetPageCMS(self.driver, self.wait, "loadFromUrl") addAssetPage.selectContentProjectAssetByIndex(1) addAssetPage.typeTitle(asset) addAssetPage.selectTypeByLabel("Pointer") addAssetPage = addAssetPage.clickToSaveAndContinueButton() addAssetPage.clickShowHideLinkForField("Media File & Transcript") addAssetPage.typeExternalLink(externalLink) addAssetPage.typeExternalTranscript(externalTranscript) addAssetPage = addAssetPage.clickToSaveAndContinueButton() addAssetPage.clickShowHideLinkForField("Media File & Transcript") self.assertEqual(addAssetPage.getExternalLink(), externalLink, "External link not saved") self.assertEqual(addAssetPage.getExternalTranscript(), externalTranscript, "External transcript not saved")
def test_mediaTypeGeneralAutomaticallyCalculated(self): self.driver.get(ServerRelated().serverToBeTested() + "admin/cms/asset/add/") addAssetPg = AddEditAssetPageCMS(self.driver, self.wait) addAssetPg.selectContentProjectAssetByIndex(1) addAssetPg.typeTitle("%s1" % self.asset) editAssetPg = addAssetPg.clickToSaveAndContinueButton() addMediaPg = editAssetPg.clickAddMediaButton() addMediaPg.typeName(self.asset) addMediaPg.typeFilePath(ServerRelated().getFilePathInProjectFolder(self.audioFilePath)) addMediaPg.clickSaveButton() self.driver.close() addMediaPg.switchToNewestWindow() self.driver.refresh() editAssetPg = AddEditAssetPageCMS(self.driver, self.wait) editAssetPg.addMediaByText(self.asset) editAssetPg.clickIsPrimaryMedia() editAssetPg = editAssetPg.clickToSaveAndContinueButton() editAssetPg.clickShowHideLinkForField("Metadata") self.assertEqual(editAssetPg.getMediaTypeGeneral(), "Audio", "Media type general not automatically calculated")