def mainDeleteLessons(self):
        try:
            d = Delete_Tags_Attributes_Lessons()
            d.deleteLesson()

            wait = WebDriverWait(driver, 60)
            wait.until(
                EC.visibility_of_element_located(
                    (By.XPATH, "//tr[1]/td[4]/button[.='Delete']")))
            ele = driver.find_elements_by_xpath(
                "//tbody/tr/td[4]/button[.='Delete']")
            count = len(ele)

            for count in range(0, count):
                d.deleteItLesson()
                driver.refresh()
                wait.until(
                    EC.element_to_be_clickable(
                        (By.XPATH, "//tr[1]/td[4]/button[.='Delete']")))
            print "All Lessons are deleted"

        finally:
            book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
    def lessonWithQuestionAnswerCard(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('TrackCreate')

        cell1 = first_sheet.cell(6, 1)
        lessonname = cell1.value

        cell2 = first_sheet.cell(7, 1)
        question = cell2.value

        cell3 = first_sheet.cell(8, 1)
        ans1 = cell3.value

        cell4 = first_sheet.cell(9, 1)
        ans2 = cell4.value

        cell5 = first_sheet.cell(10, 1)
        ans3 = cell5.value

        try:
            que = LessonCreateQuestion()
            que.createLesson(lessonname, question, ans1, ans2, ans3)

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
Example #3
0
 def lessonEditMain(self):    
     
     try:
         obj1 = LessonEdit()
         obj1.editCreatedLesson()
         obj1.lessonWithTextCardforedit()
         obj1.addQuestionCardforedit()
         obj1.addImageCardforedit(600)
         obj1.addVideoCardforedit(600)
         obj1.addDocumentCardforedit(600)
         obj1.publishLessonedit()
         obj1.clickEdit()
         print "TEST CASE EXECUTION SUCCESSFULLY COMPLETED"
     except Exception as e:
         traceback.print_exc()
         print (e)
         raise Exception
         
     finally:
         #print "clicking on Home"
         book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
         first_sheet = book.sheet_by_name('Login_Credentials')
         #print("Fetching the Attribute Name from Excel Sheet\n")
         # read a cell
         cell = first_sheet.cell(1,1)
         HomeURL = cell.value
         #print HomeURL
         driver.get(HomeURL)
    def mainDeletetag(self):
        try:
            d = Delete_Tags_Attributes_Lessons()
            wait = WebDriverWait(driver, 80)
            wait.until(
                EC.visibility_of_element_located((
                    By.XPATH,
                    "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]/a"
                )))
            driver.find_element_by_xpath(
                "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]/a"
            ).click()
            print "Clicked on admin icon"
            wait.until(
                EC.visibility_of_element_located((
                    By.XPATH,
                    "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]"
                )))
            driver.find_element_by_xpath(
                "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]"
            ).click()
            print "Clicked on Admin"
            driver.find_element_by_xpath(
                "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]/div/ul/li[5]"
            ).click()
            print "Clicked on Tag"
            time.sleep(5)

            count = driver.find_element_by_xpath(
                "//*[@id='content']/div/div[3]/div[2]/div/div/section[2]/ul/li[1]/span"
            ).text
            print count

            if count == '0':
                print "No Tags to delete"
            else:
                wait.until(
                    EC.visibility_of_element_located(
                        (By.XPATH, "//li[@class='u-inline-block']/a")))
                ele = driver.find_elements_by_xpath(
                    "//li[@class='u-inline-block']/a")
                count = len(ele)

                wait.until(
                    EC.visibility_of_element_located((
                        By.XPATH,
                        "html/body/div/div/div[3]/div[2]/div/div/section[2]/div/ul/li[1]/a"
                    )))
                print "Tag Page Loaded"

                for count in range(0, count):
                    d.delete_Tag()
                print "All Tags are deleted"
        finally:
            book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
    def campaignsPageDisplayMain(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('CreateCampaigns')

        cell1 = first_sheet.cell(1, 1)
        actualPageHeaderText = cell1.value

        cell2 = first_sheet.cell(2, 1)
        actualTextBelowHeader = cell2.value

        cell3 = first_sheet.cell(3, 1)
        actualCreateCampaignButtonText = cell3.value

        cell3 = first_sheet.cell(4, 1)
        actualGridText = cell3.value

        cell3 = first_sheet.cell(5, 1)
        actualTitleCol = cell3.value

        cell3 = first_sheet.cell(6, 1)
        actualDurationCol = cell3.value

        cell3 = first_sheet.cell(7, 1)
        actualupdatedByCol = cell3.value

        cell3 = first_sheet.cell(8, 1)
        actualactionsCol = cell3.value

        cell3 = first_sheet.cell(9, 1)
        actualEditLinkText = cell3.value

        cell3 = first_sheet.cell(10, 1)
        actualduplicateLinkText = cell3.value

        cell3 = first_sheet.cell(11, 1)
        actualassignLinkText = cell3.value

        try:
            camp = CampaignPageDisplay()
            camp.campaignPage(actualPageHeaderText, actualTextBelowHeader,
                              actualCreateCampaignButtonText, actualGridText,
                              actualTitleCol, actualDurationCol,
                              actualupdatedByCol, actualactionsCol,
                              actualEditLinkText, actualduplicateLinkText,
                              actualassignLinkText)

            print "\n----Execution Completed----\n"

        except Exception as e:
            traceback.print_exc()
            print(e)
            raise Exception

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
 def createCampaignWithAllCardsTwoTimeLesson(self):
    
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('CreateCampaigns')
     
     #Campaign Data
     cell1 = first_sheet.cell(69,1)
     campaignTitle = cell1.value
     
     cell1 = first_sheet.cell(56,1)
     campDescription = cell1.value
     
     cell1 = first_sheet.cell(71,1)
     actualSuccessMessage = cell1.value
     
     cell1 = first_sheet.cell(70,1)
     lessonName = cell1.value
     
     cell1 = first_sheet.cell(60,1)
     textCard = cell1.value
     
     cell1 = first_sheet.cell(61,1)
     Imagefilepath1 = cell1.value
     
     cell1 = first_sheet.cell(62,1)
     videoPath = cell1.value
     
     cell1 = first_sheet.cell(63,1)
     timeToUploadVideo = cell1.value
     
     cell1 = first_sheet.cell(64,1)
     documentPath = cell1.value
     
     cell1 = first_sheet.cell(65,1)
     questionCard = cell1.value
     
     cell1 = first_sheet.cell(66,1)
     ans1 = cell1.value
     
     cell1 = first_sheet.cell(67,1)
     ans2 = cell1.value
     
     
     try:
         print "\n\n----This Test case creates campaigns with all lesson cards Two times----\n\n"
         newobj=CreateCampaignForAllCardsTwoTime()
         newobj.allCardsTwoTime(lessonName, textCard, Imagefilepath1, videoPath, timeToUploadVideo, documentPath, questionCard, ans1, ans2)
         newobj.createCampaignLessonAllCardsTwoTimes(campaignTitle, campDescription, lessonName, actualSuccessMessage)
     
     except Exception as e:
         traceback.print_exc()
         print (e)
         raise Exception  
     finally:
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
    def lessonWithTextImageQuestionCard(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('TrackCreate')

        #Track Data
        cell1 = first_sheet.cell(43, 1)
        titleOfTrack = cell1.value

        cell2 = first_sheet.cell(44, 1)
        Imagefilepath = cell2.value

        cell2 = first_sheet.cell(45, 1)
        description = cell2.value

        cell2 = first_sheet.cell(46, 1)
        tagName = cell2.value

        cell2 = first_sheet.cell(47, 1)
        expectedSuccessText = cell2.value

        # Lesson Data
        cell2 = first_sheet.cell(43, 3)
        lessonname = cell2.value

        cell2 = first_sheet.cell(44, 3)
        textCard = cell2.value

        cell2 = first_sheet.cell(45, 3)
        Imagefilepath1 = cell2.value

        cell2 = first_sheet.cell(46, 3)
        questionCard = cell2.value

        cell3 = first_sheet.cell(47, 3)
        ans1 = cell3.value

        cell4 = first_sheet.cell(48, 3)
        ans2 = cell4.value

        try:
            que = TrackWithTxtImgQueLesson()
            que.createLessonTxtImgQue(lessonname, textCard, Imagefilepath1,
                                      questionCard, ans1, ans2)
            que.createTrackwithTxtImgQue(titleOfTrack, Imagefilepath,
                                         description, tagName, lessonname,
                                         expectedSuccessText)

        except Exception as e:
            traceback.print_exc()
            print(e)
            raise Exception

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
    def mainDelete_attribute(self):
        try:
            d = Delete_Tags_Attributes_Lessons()
            wait = WebDriverWait(driver, 60)
            wait.until(
                EC.visibility_of_element_located((
                    By.XPATH,
                    "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]/a"
                )))
            driver.find_element_by_xpath(
                "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]/a"
            ).click()
            print "Clicked on admin icon"
            wait.until(
                EC.visibility_of_element_located((
                    By.XPATH,
                    "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]"
                )))
            driver.find_element_by_xpath(
                "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]"
            ).click()
            print "Clicked on Admin"
            driver.find_element_by_xpath(
                "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]/div/ul/li[1]"
            ).click()
            print "Clicked on User Attribute"
            driver.find_element_by_xpath(
                "html/body/div/div/div[3]/div[1]/div/nav/div/div[2]/div[6]/div/ul/li[4]"
            ).click()
            print "User attribute Page Loaded"

            count = driver.find_element_by_xpath(
                "//*[@id='content']/div/div[3]/div[2]/div/div/ul/li[1]/span"
            ).text
            print count

            if count == '0':
                print "No Attributes to delete"
            else:
                wait.until(
                    EC.visibility_of_element_located((
                        By.XPATH,
                        "html/body/div/div/div[3]/div[2]/div/div/div/div[2]/div/table/tbody/tr[1]/td[5]/button"
                    )))
                print "Deleting all attributes"
                ele = driver.find_elements_by_xpath("//tbody/tr/td[5]/button")
                count = len(ele)

                for count in range(0, count):
                    d.deleteAttribute()
                print "All Attributes are deleted"

        finally:
            book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
Example #9
0
    def trackWithTwoLessonsImgandVid(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('TrackCreate')

        #Track Data
        cell1 = first_sheet.cell(79, 1)
        titleOfTrack = cell1.value

        cell2 = first_sheet.cell(80, 1)
        Imagefilepath = cell2.value

        cell2 = first_sheet.cell(81, 1)
        description = cell2.value

        cell2 = first_sheet.cell(82, 1)
        tagName = cell2.value

        cell2 = first_sheet.cell(83, 1)
        expectedSuccessText = cell2.value

        # Lesson Data

        cell2 = first_sheet.cell(79, 3)
        lessonNameforImgcard = cell2.value

        cell2 = first_sheet.cell(80, 3)
        Imagefilepath1 = cell2.value

        cell2 = first_sheet.cell(82, 3)
        lessonNameforVidcard = cell2.value

        cell2 = first_sheet.cell(83, 3)
        videoPath = cell2.value

        cell2 = first_sheet.cell(84, 3)
        timeToUploadVideo = cell2.value

        print "\n\nSetting Pre-requisite"
        print "Creating Two lessons\n"

        try:
            tr1 = TrackWithImgLessonVidLesson()
            tr1.lessonWithImage(lessonNameforImgcard, Imagefilepath1)
            tr1.lessonWithVideo(lessonNameforVidcard, videoPath,
                                timeToUploadVideo)
            tr1.createTrackwithImgAndVideoLesson(titleOfTrack, Imagefilepath,
                                                 description, tagName,
                                                 lessonNameforImgcard,
                                                 lessonNameforVidcard,
                                                 expectedSuccessText)

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
    def againuserLogin(self):

        print "Reading data from excel sheet"
        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))

        # print number of sheets
        print("Number of WorkSheets :")
        print book.nsheets

        # print sheet names
        #print("Name of WorkSheets :")
        #print book.sheet_names()

        # get the first worksheet
        first_sheet = book.sheet_by_name('Login_Credentials')

        # read a row
        #print("First Row Data in 1st WorkSheet :")
        #print first_sheet.row_values(0)

        print("Fetching the URL, username and password from Excel Sheet\n")
        # read a cell
        cell = first_sheet.cell(1, 1)
        url = cell.value
        print url

        cell = first_sheet.cell(3, 1)
        username = cell.value
        print username

        cell = first_sheet.cell(3, 2)
        password = cell.value
        print password

        driver.get(url)
        element = WebDriverWait(driver, 10).until(
            EC.presence_of_element_located((By.ID, "password")))
        if driver.title == "Grovo":
            print("Grovo Application URL Opened")
        else:
            raise Exception.message

        print "Grovo Sign-In page is displayed"

        print "Entering User name"
        driver.find_element_by_xpath(".//*[@id='username']").send_keys(
            username)

        print "Entering Password"
        element.send_keys(password)

        element.send_keys(Keys.TAB)
        print "Clicking on Sign_In button"
        driver.find_element_by_xpath("//*[@id='submitButton']").click()

        print "Successfully Loged Into Grovo Application"
        time.sleep(5)
Example #11
0
    def createCampaignTextImageQuesLesson(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('CreateCampaigns')

        #Campaign Data
        cell1 = first_sheet.cell(75, 1)
        campaignTitle = cell1.value

        cell1 = first_sheet.cell(76, 1)
        campDescription = cell1.value

        cell1 = first_sheet.cell(77, 1)
        actualSuccessMessage = cell1.value

        cell1 = first_sheet.cell(85, 1)
        minPassingScore = cell1.value

        cell1 = first_sheet.cell(79, 1)
        lessonName = cell1.value

        cell1 = first_sheet.cell(80, 1)
        textCard = cell1.value

        cell1 = first_sheet.cell(81, 1)
        Imagefilepath1 = cell1.value

        cell1 = first_sheet.cell(82, 1)
        questionCard = cell1.value

        cell1 = first_sheet.cell(83, 1)
        ans1 = cell1.value

        cell1 = first_sheet.cell(84, 1)
        ans2 = cell1.value

        try:
            print "\n\n----This test case creates campaign with----\n1. Text,Image and Question lesson\n"
            newobj = CreateCampaignForTxtImgQueLesson()
            newobj.createLessonTxtImgQue(lessonName, textCard, Imagefilepath1,
                                         questionCard, ans1, ans2)
            newobj.createCampaignTxtImgQues(campaignTitle, campDescription,
                                            lessonName, actualSuccessMessage,
                                            minPassingScore)

        except Exception as e:
            traceback.print_exc()
            print(e)
            raise Exception

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
 def lessonWithVideoDocumentQuestionCard(self):
     
     
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('TrackCreate')
     
     #Track Data
     cell1 = first_sheet.cell(52,1)
     titleOfTrack = cell1.value
     
     cell2 = first_sheet.cell(53,1)
     Imagefilepath = cell2.value
     
     cell2 = first_sheet.cell(54,1)
     description = cell2.value
     
     cell2 = first_sheet.cell(55,1)
     tagName = cell2.value
     
   
     cell2 = first_sheet.cell(56,1)
     expectedSuccessText= cell2.value
     
     # Lesson Data
     cell2 = first_sheet.cell(52,3)
     lessonname= cell2.value
     
     cell2 = first_sheet.cell(53,3)
     videoPath= cell2.value
     
     cell2 = first_sheet.cell(54,3)
     documentPath= cell2.value
    
     cell2 = first_sheet.cell(55,3)
     questionCard = cell2.value
     
     cell3 = first_sheet.cell(56,3)
     ans1 = cell3.value
     
     cell4 = first_sheet.cell(57,3)
     ans2 = cell4.value
     
     cell4 = first_sheet.cell(53,4)
     timeToUploadVideo = cell4.value
  
  
     try:
         que=TrackWithVidDocQueLesson()
         que.createLessonVidDocQue(lessonname, videoPath, documentPath, questionCard, ans1, ans2,timeToUploadVideo)
         que.createTrackwithVidDocQue(titleOfTrack, Imagefilepath, description, tagName, lessonname, expectedSuccessText)
     finally:
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
Example #13
0
 def lessonWithDocumentCard(self):
     
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('TrackCreate')
     
     cell1 = first_sheet.cell(34,1)
     titleOfTrack = cell1.value
     
     cell2 = first_sheet.cell(35,1)
     Imagefilepath = cell2.value
     
     print "Image file path"
     print Imagefilepath 
     
     cell2 = first_sheet.cell(36,1)
     description = cell2.value
     
     cell2 = first_sheet.cell(37,1)
     tagName = cell2.value
     
     cell2 = first_sheet.cell(34,3)
     lessonname= cell2.value
     
   
     cell2 = first_sheet.cell(38,1)
     expectedSuccessText= cell2.value
     
    
     cell2 = first_sheet.cell(35,3)
     documentPath = cell2.value
     
     print "Document file path"
     print documentPath 
     
     cell2 = first_sheet.cell(36,3)
     timeToUploaddocument = cell2.value
     
     try:     
         doc=TrackWithDocumentLesson()
         doc.lessonWithDocument(lessonname, documentPath, timeToUploaddocument)
         doc.createTrackwithDocument(titleOfTrack, Imagefilepath, description, tagName, lessonname, expectedSuccessText)
     
     except Exception as e:
         traceback.print_exc()
         print (e)
         raise Exception
     
     finally:   
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
 def BasicInformationWithDirectRole(self):
     try:
         obj=BasicInformationWithDirectRole_28()  
         obj.userCreationWithDirectRole()
         obj.Logincreateuser()
         obj.againuserLogin()
         
     finally:
         book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
 def mainDeleteAll(self):
     try:
         d = Delete_Tags_Attributes_Lessons()
         d.mainDeletetag()
         d.mainDelete_attribute()
         d.mainDeleteLessons()
     # d.deactivateuser()
     finally:
         book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1, 1)
         url = cell.value
         driver.get(url)
Example #16
0
    def UpdationOfExcelValues(self):

        try:

            update = UpdatingUserDetails()
            update.mainUpdateExcelWithUserDetails()

        finally:
            book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
Example #17
0
 def TrackWithTxtLessonImageLesson(self):
     
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('TrackCreate')
     
     #Track Data
     cell1 = first_sheet.cell(70,1)
     titleOfTrack = cell1.value
     
     cell2 = first_sheet.cell(71,1)
     Imagefilepath = cell2.value
     
     cell2 = first_sheet.cell(72,1)
     description = cell2.value
     
     cell2 = first_sheet.cell(73,1)
     tagName = cell2.value
     
   
     cell2 = first_sheet.cell(74,1)
     expectedSuccessText= cell2.value
     
     # Lesson Data
     cell2 = first_sheet.cell(70,3)
     lessonNameforTextcard= cell2.value
     
     cell2 = first_sheet.cell(71,3)
     textCard= cell2.value
     
     cell2 = first_sheet.cell(73,3)
     lessonNameforImgcard = cell2.value
     
     cell2 = first_sheet.cell(74,3)
     Imagefilepath1= cell2.value
    
     
     print "Setting Pre-requisite"
     print "Creating Two lessons\n"
  
     try:
         tr1=TrackWithTxtLessonImgLesson()
         tr1.lessonWithText(lessonNameforTextcard, textCard)
         tr1.lessonWithImage(lessonNameforImgcard, Imagefilepath1)
         tr1.createTrackwithTxtAndImgLesson(titleOfTrack, Imagefilepath, description, tagName, lessonNameforTextcard,lessonNameforImgcard, expectedSuccessText)
 
     finally:
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
Example #18
0
    def createCampaignWithImageLessonVideoLesson(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('CreateCampaigns')

        #Campaign Data
        cell1 = first_sheet.cell(132, 1)
        campaignTitle = cell1.value

        cell1 = first_sheet.cell(133, 1)
        campDescription = cell1.value

        cell1 = first_sheet.cell(134, 1)
        actualSuccessMessage = cell1.value

        cell1 = first_sheet.cell(136, 1)
        lessonName1 = cell1.value

        cell1 = first_sheet.cell(137, 1)
        Imagefilepath1 = cell1.value

        cell1 = first_sheet.cell(138, 1)
        lessonName2 = cell1.value

        cell1 = first_sheet.cell(139, 1)
        videoPath = cell1.value

        cell1 = first_sheet.cell(140, 1)
        timeToUploadVideo = cell1.value

        try:
            print "\n\n----This test case creates campaign with----\n1. Image lesson\n2. Video lesson\n"
            newobj = CreateCampaignForImageAndVideoLesson()
            newobj.lessonWithImage(lessonName1, Imagefilepath1)
            newobj.lessonWithVideo(lessonName2, videoPath, timeToUploadVideo)
            newobj.createCampaignImageAndVideoLessons(campaignTitle,
                                                      campDescription,
                                                      actualSuccessMessage,
                                                      lessonName1, lessonName2)

        except Exception as e:
            traceback.print_exc()
            print(e)
            raise Exception

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
    def createCampaignQuestionLesson(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('CreateCampaigns')

        #Campaign Data
        cell1 = first_sheet.cell(44, 1)
        campaignTitle = cell1.value

        cell1 = first_sheet.cell(45, 1)
        campDescription = cell1.value

        cell1 = first_sheet.cell(46, 1)
        actualSuccessMessage = cell1.value

        cell1 = first_sheet.cell(48, 1)
        lessonName = cell1.value

        cell1 = first_sheet.cell(49, 1)
        questionCard = cell1.value

        cell1 = first_sheet.cell(50, 1)
        ans1 = cell1.value

        cell1 = first_sheet.cell(51, 1)
        ans2 = cell1.value

        cell1 = first_sheet.cell(52, 1)
        numberOfAttempts = cell1.value

        try:
            print "\n\n----This test case creates campaign with----\n1. Question lesson\n"
            newobj = CreateCampaignForQuestionLesson()
            newobj.lessonWithQuestion(lessonName, questionCard, ans1, ans2)
            newobj.createCampaignForQuestionLesson(campaignTitle,
                                                   campDescription, lessonName,
                                                   actualSuccessMessage,
                                                   numberOfAttempts)

        except Exception as e:
            traceback.print_exc()
            print(e)
            raise Exception

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
Example #20
0
 def lessonWithQuestionAnswerCard(self):
     
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('TrackCreate')
     
     cell1 = first_sheet.cell(10,1)
     titleOfTrack = cell1.value
     
     cell2 = first_sheet.cell(11,1)
     Imagefilepath = cell2.value
     
     cell2 = first_sheet.cell(12,1)
     description = cell2.value
     
     cell2 = first_sheet.cell(13,1)
     tagName = cell2.value
     
     cell2 = first_sheet.cell(10,3)
     lessonname= cell2.value
     
   
     cell2 = first_sheet.cell(14,1)
     expectedSuccessText= cell2.value
     
    
     cell2 = first_sheet.cell(11,3)
     question = cell2.value
     
     cell3 = first_sheet.cell(12,3)
     ans1 = cell3.value
     
     cell4 = first_sheet.cell(13,3)
     ans2 = cell4.value
  
     try:     
         que=TrackWithQuestionLesson()
         que.createLesson(lessonname, question,ans1,ans2)
         que.createTrackwithQuestion(titleOfTrack, Imagefilepath, description, tagName, lessonname, expectedSuccessText)
         
     except Exception as e:
         traceback.print_exc()
         print (e)
         raise Exception
     
     finally:
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
 def createTagForLessonTextlesson(self):
  try :
     obj2= CreateTagLessonTextLesson()
     obj2.createLessonTextLessontag() 
  finally:  
     print "clicking on Home"
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('Login_Credentials')
     print("Fetching the Attribute Name from Excel Sheet\n")
     # read a cell
     cell = first_sheet.cell(1,1)
     HomeURL = cell.value
     print HomeURL
     driver.get(HomeURL)
     wait=WebDriverWait(driver, 80)
     wait.until(EC.visibility_of_element_located((By.ID,"global-header-search")))
     print "Home Page Loaded"
 def createCampaignWithTextLessonImageLesson(self):
    
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('CreateCampaigns')
     
     #Campaign Data
     cell1 = first_sheet.cell(121,1)
     campaignTitle = cell1.value
     
     cell1 = first_sheet.cell(122,1)
     campDescription = cell1.value
     
     cell1 = first_sheet.cell(123,1)
     actualSuccessMessage = cell1.value
     
     cell1 = first_sheet.cell(125,1)
     lessonNameForTextLesson = cell1.value
     
     cell1 = first_sheet.cell(126,1)
     textCard = cell1.value
     
     cell1 = first_sheet.cell(127,1)
     lessonNameforImageLesson = cell1.value
     
     cell1 = first_sheet.cell(128,1)
     Imagefilepath1 = cell1.value
     
   
     
     try:
         print "\n\n----This test case creates campaign with----\n1. Text lesson\n2. Image lesson\n"
         newobj=CreateCampaignForTextAndImageLesson()
         newobj.lessonWithText(lessonNameForTextLesson, textCard)
         newobj.lessonWithImage(lessonNameforImageLesson, Imagefilepath1)
         newobj.createCampaignTxtAndImageLessons(campaignTitle, campDescription, actualSuccessMessage, lessonNameForTextLesson, lessonNameforImageLesson)
      
     except Exception as e:
         traceback.print_exc()
         print (e)
         raise Exception   
        
     finally:
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
Example #23
0
    def createdUserDeactivation(self):
        try:
            ob = DeactivateUser()
            ob.userDeactivation()

        finally:
            print "clicking on Home"
            book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
            first_sheet = book.sheet_by_name('Login_Credentials')
            print("Fetching the Attribute Name from Excel Sheet\n")
            # read a cell
            cell = first_sheet.cell(1, 1)
            HomeURL = cell.value
            print HomeURL
            driver.get(HomeURL)

            print "Home Page Loaded"
Example #24
0
    def createCampaignDocumentLesson(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('CreateCampaigns')

        #Campaign Data
        cell1 = first_sheet.cell(35, 1)
        campaignTitle = cell1.value

        cell1 = first_sheet.cell(36, 1)
        campDescription = cell1.value

        cell1 = first_sheet.cell(37, 1)
        actualSuccessMessage = cell1.value

        cell1 = first_sheet.cell(39, 1)
        lessonname = cell1.value

        cell1 = first_sheet.cell(40, 1)
        documentPath = cell1.value

        cell1 = first_sheet.cell(41, 1)
        timeToUploaddocument = cell1.value

        cell1 = first_sheet.cell(6, 4)
        textCard = cell1.value

        try:
            print "\n\n----This Test case creates campaigns with Document Card----\n\n"
            newobj = CreateCampaignForDocumentLesson()
            newobj.lessonWithDocument(lessonname, documentPath,
                                      timeToUploaddocument, textCard)
            newobj.createCampaignForDocumentLesson(campaignTitle,
                                                   campDescription, lessonname,
                                                   actualSuccessMessage)

        except Exception as e:
            traceback.print_exc()
            print(e)
            raise Exception

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
Example #25
0
    def createLearnerUserAndValidation(self):

        try:
            ob = CreateLearner()
            ob.creatLearnereuser()
            ob.createLearnerLogin()
            ob.againuserLogin()

        finally:
            book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
            first_sheet = book.sheet_by_name('Login_Credentials')
            print("Fetching the Attribute Name from Excel Sheet\n")
            # read a cell
            cell = first_sheet.cell(1, 1)
            HomeURL = cell.value
            print HomeURL
            driver.get(HomeURL)

            print "Home Page Loaded"
    def lessonWithTextCard(self):

        book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
        first_sheet = book.sheet_by_name('LessonCreate')

        cell1 = first_sheet.cell(1, 1)
        lessonname = cell1.value

        cell2 = first_sheet.cell(2, 1)
        textCardText = cell2.value

        try:
            obj1 = LessonCreateText()
            obj1.lessonWithText(lessonname, textCardText)

        finally:
            second_sheet = book.sheet_by_name('Login_Credentials')
            cell = second_sheet.cell(1, 1)
            url = cell.value
            driver.get(url)
Example #27
0
 def lessonWithImageUploadCard(self):
     
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('LessonCreate')
     
     cell1 = first_sheet.cell(14,1)
     lessonname = cell1.value
     
     cell2 = first_sheet.cell(15,1)
     imagefilepath = cell2.value
     
     try:
         img=LessonCreateImage()
         img.lessonWithImage(lessonname, imagefilepath)
       
     finally:  
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
Example #28
0
 def lessonWithImageCard(self):
     
     book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
     first_sheet = book.sheet_by_name('TrackCreate')
     
     cell1 = first_sheet.cell(18,1)
     titleOfTrack = cell1.value
     
     cell2 = first_sheet.cell(19,1)
     Imagefilepath = cell2.value
     
     cell2 = first_sheet.cell(20,1)
     description = cell2.value
     
     cell2 = first_sheet.cell(21,1)
     tagName = cell2.value
     
     cell2 = first_sheet.cell(18,3)
     lessonname= cell2.value
   
     cell2 = first_sheet.cell(22,1)
     expectedSuccessText= cell2.value
    
     cell2 = first_sheet.cell(19,3)
     ImagefilepathforLesson = cell2.value
     
     try:
         img=TrackWithImageLesson()
         img.lessonWithImage(lessonname, ImagefilepathforLesson)
         img.createTrackwithImage(titleOfTrack, Imagefilepath, description, tagName, lessonname, expectedSuccessText)
     
     except Exception as e:
         traceback.print_exc()
         print (e)
         raise Exception
     
     finally:
         second_sheet = book.sheet_by_name('Login_Credentials')
         cell = second_sheet.cell(1,1)
         url = cell.value
         driver.get(url)
Example #29
0
 def teachASkillMain(self): 
     try:
         obj1 = TeachASkill()
         obj1.teachASkills()
         obj1.publishLesson()
         print "TEST CASE EXECUTION SUCCESSFULLY COMPLETED"
     except Exception as e:
         traceback.print_exc()
         print (e)
         raise Exception
         
     finally:
         #print "clicking on Home"
         book=xlrd.open_workbook(os.path.join('TestData.xlsx'))
         first_sheet = book.sheet_by_name('Login_Credentials')
         #print("Fetching the Attribute Name from Excel Sheet\n")
         # read a cell
         cell = first_sheet.cell(1,1)
         HomeURL = cell.value
         #print HomeURL
         driver.get(HomeURL)
    def createUserReferenceAttributeWithoutRequiredField(self):
        try:

            ob = UserAttributeUserReferenceWithoutReq()
            ob.createUserReferenceAttributewithoutReq()

        finally:
            print "clicking on Home"
            book = xlrd.open_workbook(os.path.join('TestData.xlsx'))
            first_sheet = book.sheet_by_name('Login_Credentials')
            print("Fetching the Attribute Name from Excel Sheet\n")
            # read a cell
            cell = first_sheet.cell(1, 1)
            HomeURL = cell.value
            print HomeURL
            driver.get(HomeURL)
            wait = WebDriverWait(driver, 80)
            wait.until(
                EC.visibility_of_element_located(
                    (By.ID, "global-header-search")))
            print "Home Page Loaded"