def setup_class(self): self.driver = WebDriverFactory().getWebDriverInstance() self.loginPage = loginPage(self.driver) self.createCampaignPage = campaignCreatePage(self.driver) self.incentivePage = incentivePage(self.driver) self.listPage = listPage(self.driver, newFilterEnabled=True) self.messagePage = messagePage(self.driver) self.loginPage.login(userName=constant.config['intouchUsername'], password=constant.config['intouchPassword'])
def setup_class(self): self.driver = WebDriverFactory().getWebDriverInstance() self.loginPage = loginPage(self.driver) self.creativePage = creativePage(self.driver) self.createCampaignPage = campaignCreatePage(self.driver) self.loginPage.login(userName=constant.config['intouchUsername'], password=constant.config['intouchPassword']) self.loginPage.switchOrgUsingCookies() self.createCampaignPage.goToCampaignSection() self.createCampaignPage.goToCreativesPage() self.creativePage.skipGuide() self.creativeBaseURL = self.creativePage.captureCurrentURL()
def setup_class(self): BaseState.moduleFlip('timeline') constant.config['timeline_templateName'] = constant.timelineDetails[ constant.config['cluster']] self.driver = WebDriverFactory().getWebDriverInstance() self.createCampaignPage = campaignCreatePage(self.driver) self.incentivePage = incentivePage(self.driver) self.timelinePages = timelinePages(self.driver) self.loginPage = loginPage(self.driver) constant.config[ 'segment'] = self.timelinePages.setupListForTimelineExection()
class Test_Timeline(object, SeleniumDriver): def setup_class(self): BaseState.moduleFlip('timeline') constant.config['timeline_templateName'] = constant.timelineDetails[ constant.config['cluster']] self.driver = WebDriverFactory().getWebDriverInstance() self.createCampaignPage = campaignCreatePage(self.driver) self.incentivePage = incentivePage(self.driver) self.timelinePages = timelinePages(self.driver) self.loginPage = loginPage(self.driver) constant.config[ 'segment'] = self.timelinePages.setupListForTimelineExection() def setup_method(self): self.timelinePages.consumerCheckInRabitMQCheck() self.loginPage.login(userName=constant.config['intouchUsername'], password=constant.config['intouchPassword']) self.loginPage.switchOrgUsingCookies() self.createCampaignPage.goToCampaignSection() self.createCampaignPage.openNewCampaignCreationForm() def teardown_class(self): if constant.config['moduleFlip']: BaseState.moduleFlip(-1) def teardown_method(self): self.driver.quit() def test_timeline_Sanity(self, request): self.campaignName = 'TimelineSanity' + str(int(time.time())) try: self.createCampaignPage.createTimelineCampaign( self.campaignName, timelineEndTime=constant.timelineDetails[ constant.config['cluster']]['timelineEndTime']) self.timelinePages.createNewTimeline() self.timelinePages.fillTimelineDetails() self.timelinePages.selectSegment(constant.config['segment']) self.timelinePages.selectStartDateForCustomers() self.timelinePages.configureMilestione() self.timelinePages.selectIncentive() self.timelinePages.customizeContent( constant.config['timeline_templateName']['templateName']) self.timelinePages.saveMileston() self.timelinePages.saveAndExitTimeline() self.timelinePages.setCompressionFactor() self.timelinePages.rollOutCampaign() TimelineDBAssertion(self.campaignName).check() except Exception, exp: self.getScreenshot(request.node.name) Assertion.constructAssertion(False, exp)
def setup_class(self): self.driver = WebDriverFactory().getWebDriverInstance() self.loginPage = loginPage(self.driver) self.createCampaignPage = campaignCreatePage(self.driver) self.incentivePage = incentivePage(self.driver) self.listPage = listPage(self.driver) self.messagePage = messagePage(self.driver) self.loginPage.login(userName=constant.config['intouchUsername'], password=constant.config['intouchPassword']) self.oldOrgId = construct.updateOrgId(constant.config['wechat']['orgId']) self.oldOrgName = construct.updateOrgName(constant.config['wechat']['orgName']) dbHelper.getIntouchShardNameForOrg() self.loginPage.switchOrgUsingCookies(constant.config['wechat']['orgId'])
class Test_CampaignsNewUI(object, SeleniumDriver): def setup_class(self): self.driver = WebDriverFactory().getWebDriverInstance() self.loginPage = loginPage(self.driver) self.createCampaignPage = createCampaignPage(self.driver) self.incentivePage = incentivePage(self.driver) self.listPage = listPage(self.driver, newFilterEnabled=True) self.messagePage = messagePage(self.driver) self.loginPage.login(userName=constant.config['intouchUsername'], password=constant.config['intouchPassword']) self.loginPage.switchOrgUsingCookies() def teardown_class(self): try: self.driver.quit() except Exception, exp: assert False, 'Exception Occured while Closing Browser , Need to Close Browser manually'
class Test_Wechat(object, SeleniumDriver): def setup_class(self): self.driver = WebDriverFactory().getWebDriverInstance() self.loginPage = loginPage(self.driver) self.createCampaignPage = campaignCreatePage(self.driver) self.incentivePage = incentivePage(self.driver) self.listPage = listPage(self.driver) self.messagePage = messagePage(self.driver) self.loginPage.login(userName=constant.config['intouchUsername'], password=constant.config['intouchPassword']) self.oldOrgId = construct.updateOrgId(constant.config['wechat']['orgId']) self.oldOrgName = construct.updateOrgName(constant.config['wechat']['orgName']) dbHelper.getIntouchShardNameForOrg() self.loginPage.switchOrgUsingCookies(constant.config['wechat']['orgId']) def teardown_class(self): try: self.driver.quit() except Exception, exp: assert False , 'Exception Occured while Closing Browser , Need to Close Browser manually' finally:
class Test_Creatives(object, SeleniumDriver): def setup_class(self): self.driver = WebDriverFactory().getWebDriverInstance() self.loginPage = loginPage(self.driver) self.creativePage = creativePage(self.driver) self.createCampaignPage = campaignCreatePage(self.driver) self.loginPage.login(userName=constant.config['intouchUsername'], password=constant.config['intouchPassword']) self.loginPage.switchOrgUsingCookies() self.createCampaignPage.goToCampaignSection() self.createCampaignPage.goToCreativesPage() self.creativePage.skipGuide() self.creativeBaseURL = self.creativePage.captureCurrentURL() def teardown_class(self): self.driver.quit() @pytest.mark.parametrize('channel,templateName,tags', [ ('sms', 'generic', ['First Name', 'Last Name', 'Full Name', 'Mobile Number', 'Optout']), ]) def test_sms_creative(self, request, channel, templateName, tags): if self.creativeBaseURL != '' :self.creativePage.setCreativePageURL(self.creativeBaseURL) templateName = templateName + str(int(time.time() * 1000)) try: self.creativePage.selectChannelToCreateTemplate() self.creativePage.waitForChannelmainContentToLoad() self.creativePage.createTemplate() templateName = self.creativePage.templateName(templateName, channel) self.creativePage.templateFillSMS() self.creativePage.selectTags(tags) self.creativePage.saveTemplate() self.creativePage.searchAndVerifyCreatedTemplate(templateName) self.creativePage.validateDBForTemplate(channel, templateName) except Exception, exp: self.getScreenshot(request.node.name) Assertion.constructAssertion(False, exp)