Beispiel #1
0
    def test_02_empty_localdirpath(self):
        driver1 = self.driver1
        memory = "60"
        core = "90"
        myurl = Myurl(self.driver1)
        myurl.access_url()
        #self.driver1.get("http://35.165.255.128:3010/users/login")
        sleep(2)

        cookies = pickle.load(open("cookies.pkl", "rb"))
        # print("get cookie vlaues ", cookies)
        sleep(1)
        for cookie_dict in cookies:
            driver1.add_cookie(cookie_dict)
            # print("this is for loop")
        #self.driver1.get("http://35.165.255.128:3010/accessUI/5c7e501310ec7c705d33423c")
        myurl.acces_user()

        raptui = RaptUi(driver1)
        raptui.T_Flow()
        print("Selected Tensorflow")
        sleep(1)
        # tensorflow.inception()
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        # inception = self.driver1.find_elements_by_xpath("(//*[@class='card border border-primary'])[0]")
        inception.click()
        sleep(1)

        raptui.Localfolder()
        path = ""
        sleep(1)
        raptui.set_localpath(path)
        sleep(1)
        print("Your given path ", path)
        raptui.Gpu()
        sleep(1)
        raptui.Auto()
        sleep(1)
        print("Your selected Auto")

        raptui.Setupbtn()
        sleep(5)
        # -------- Alert start ----------------
        # Switch the control to the Alert window
        obj = driver1.switch_to.alert
        sleep(2)
        # Retrieve the message on the Alert window
        msg = obj.text
        print("Alert shows following message: " + msg)
        sleep(2)
        # use the accept() method to accept the alert
        obj.accept()
        sleep(5)
        # ------------ Alert end -------------
        try:

            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))
Beispiel #2
0
    def test_04_empty_s3_bucket_name(self):
        driver1 = self.driver1
        myurl = Myurl(self.driver1)
        myurl.access_url()
        #self.driver1.get("http://35.165.255.128:3010/users/login")
        sleep(2)

        cookies = pickle.load(open("cookies.pkl", "rb"))
        # print("get cookie vlaues ", cookies)
        sleep(1)
        for cookie_dict in cookies:
            driver1.add_cookie(cookie_dict)
            # print("this is for loop")
        #self.driver1.get("http://35.165.255.128:3010/accessUI/5c7e501310ec7c705d33423c")
        myurl.acces_user()

        raptui = RaptUi(driver1)
        raptui.T_Flow()
        print("Selected Tensorflow")
        sleep(1)
        # tensorflow.inception()
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        # inception = self.driver1.find_elements_by_xpath("(//*[@class='card border border-primary'])[0]")
        inception.click()
        sleep(1)
        print("Selected Inception")
        raptui.S3()
        print("S3 Selected")
        bktname = ""
        bktkeys = "AKIAITOV7UZRONOPBIHA:PmlQsH2tg7+7jexDMPzN0VGat/9VPa6BIapcAPYe"
        raptui.Becket_name(bktname)
        sleep(1)
        raptui.Becket_keys(bktkeys)
        sleep(1)
        raptui.Gpu()
        sleep(1)
        raptui.Auto()
        sleep(1)
        print("Your selected Auto")
        raptui.Setupbtn()
        sleep(2)
        #-------- Alert start ----------------
        # Switch the control to the Alert window
        obj = driver1.switch_to.alert
        sleep(2)
        # Retrieve the message on the Alert window
        msg = obj.text
        print("Alert shows following message: " + msg)
        sleep(2)
        # use the accept() method to accept the alert
        obj.accept()
        sleep(5)
        # ------------ Alert end -------------
        try:

            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))
Beispiel #3
0
    def test_13_Invalid_Nfs_Path(self):
        driver1 = self.driver1
        memory = "60"
        core = "90"
        myurl = Myurl(self.driver1)
        myurl.access_url()
        # self.driver1.get("http://35.165.255.128:3010/users/login")
        sleep(2)

        cookies = pickle.load(open("cookies.pkl", "rb"))
        # print("get cookie vlaues ", cookies)
        sleep(1)
        for cookie_dict in cookies:
            driver1.add_cookie(cookie_dict)
            # print("this is for loop")
        # self.driver1.get("http://35.165.255.128:3010/accessUI/5c7e501310ec7c705d33423c")
        myurl.acces_user()

        raptui = RaptUi(driver1)
        raptui.T_Flow()
        print("Selected Tensorflow")
        sleep(1)
        # tensorflow.inception()
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        # inception = self.driver1.find_elements_by_xpath("(//*[@class='card border border-primary'])[0]")
        inception.click()
        sleep(1)
        raptui.Nfs()
        sysip = "52.32.163.231"
        exppath = "/home/ubuntu/tensorflow-UI"
        path = "/home/ubuntu/tensorflow"
        print("Nfs selected")
        raptui.NfsSysIp(sysip)
        sleep(1)
        raptui.NfsPath(path)
        sleep(1)
        raptui.Gpu()
        sleep(1)
        raptui.Auto()
        sleep(1)
        print("Your selected Auto")

        raptui.Setupbtn()
        sleep(3)
        self.assertEqual(exppath, path, "Invalid NFS Path")

        try:
            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))
Beispiel #4
0
    def test_07_invalid_s3_bucket_keys(self):
        driver1 = self.driver1
        myurl = Myurl(self.driver1)
        myurl.access_url()
        #self.driver1.get("http://35.165.255.128:3010/users/login")
        sleep(2)

        cookies = pickle.load(open("cookies.pkl", "rb"))
        # print("get cookie vlaues ", cookies)
        sleep(1)
        for cookie_dict in cookies:
            driver1.add_cookie(cookie_dict)
            # print("this is for loop")
        #self.driver1.get("http://35.165.255.128:3010/accessUI/5c7e501310ec7c705d33423c")
        myurl.acces_user()

        raptui = RaptUi(driver1)
        raptui.T_Flow()
        print("Selected Tensorflow")
        sleep(1)
        # tensorflow.inception()
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        # inception = self.driver1.find_elements_by_xpath("(//*[@class='card border border-primary'])[0]")
        inception.click()
        sleep(1)
        print("Selected Inception")
        raptui.S3()
        print("S3 Selected")
        bktname = "rapt-data-bucket"
        bktkeys = "23434ljjljfd3343434lkjjkjfdkj43"

        raptui.Becket_name(bktname)
        sleep(1)
        raptui.Becket_keys(bktkeys)
        sleep(1)
        raptui.Gpu()
        sleep(1)
        raptui.Auto()
        sleep(1)
        print("Your selected Auto")
        raptui.Setupbtn()
        sleep(3)
        expbktkeys = "AKIAITOV7UZRONOPBIHA:PmlQsH2tg7+7jexDMPzN0VGat/9VPa6BIapcAPYe"
        self.assertEqual(expbktkeys, bktkeys, "Invalid bucket keys")
        try:

            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))
Beispiel #5
0
    def pgan_auto(self):

        driver1 = self.driver1
        myurl = Myurl(self.driver1)
        myurl.access_url()
        driver1.implicitly_wait(10)
        print("User-2 This is Title name :", driver1.title)
        # ScreenShot Relative Path
        ss_path = '/K8s_UI/Parallel_MultiUser/'
        # Creating object of screenshot utility
        ss = SS(driver1)

        # ------- Login Details ------------
        user = LoginUsers()
        Admin = user.user2_name
        Pwd = user.user2_password
        expected_username = user.user2_expadmin
        expected_password = user.user2_exppass
        # ------ local path ------------
        paths = Paths()
        locpath = paths.Local_path
        # -------Pgan path -----------
        pgan_path = paths.Pgan_path

        user = self.driver1.find_element_by_name("username")
        user.send_keys(Admin)
        sleep(1)
        pwd = self.driver1.find_element_by_name("password")
        pwd.send_keys(Pwd)
        sleep(1)
        # self.driver1.find_element_by_class_name("btn btn-primary").click() ----this getting error
        # self.driver1.find_element_by_partial_link_text("Submit").click() ----this getting error--
        sub = self.driver1.find_element_by_tag_name("button")
        sub.click()
        for Logedout in self.driver1.find_elements_by_xpath(
                "//*[@class='alert alert-success']"):
            assert isinstance(Logedout.text, object)
            assert (print(str(Logedout.text)))
        if (Admin == expected_username and Pwd == expected_password):
            print("Login successful")
        else:
            assert (print("failed to login"))
        # print("Login Successfull")
        sleep(3)
        print("************ Pgan Auto *****************")
        # --------Frame work--------------
        # f = self.driver1.find_element_by_class_name("f-image mxnet text-center")
        f = self.driver1.find_element_by_xpath(
            "//img[@src='/images/tenserflow.png']")
        f.click()
        print("Selected Tensorflow")
        sleep(2)
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        inception.click()
        sleep(1)
        print("Selected Inception")

        # -----------local folder---------------
        local = self.driver1.find_element(By.ID, 'r100')
        local.click()
        sleep(1)
        localpath = self.driver1.find_element(By.ID, 'local_dir_path')
        localpath.send_keys(locpath)

        # ----------GPU Auto --------
        gpu = self.driver1.find_element(By.ID, 'r4')
        gpu.click()
        sleep(2)
        auto = self.driver1.find_element_by_id("r101")
        auto.click()
        sleep(2)
        print("Your selected Auto")
        # ------Screenshot-1-----------
        ss.ScreenShot(ss_path + "test_04_singlGpu_pgan_auto_setupscreen1.png")
        # -----Setup screen ------------
        setupbtn = self.driver1.find_element(By.ID, 'setupbtn')
        setupbtn.click()
        sleep(28)

        # -------Datsets & Training  ----------------
        traindir = self.driver1.find_element(By.ID, 'traindirectory')
        trdirectory = Select(traindir)
        trdirectory.select_by_visible_text("pgan")
        sleep(2)

        trinfile = self.driver1.find_element(By.ID, 'file_name')
        trfile = Select(trinfile)
        trfile.select_by_visible_text("train.py")
        sleep(2)

        # --------- Train --------------------
        train = self.driver1.find_element_by_xpath("//a[@href='#train']")
        train.click()
        sleep(2)
        textpath = self.driver1.find_element_by_id("textVal")
        textpath.clear()
        textpath.send_keys(pgan_path)
        sleep(2)
        Train = self.driver1.find_element(By.ID, 'train_id')
        Train.click()

        sleep(200)
        # ------- Gpu Usage --------------------
        gpuTime = driver1.find_elements_by_id("gputime")
        for GpuUsage in gpuTime:
            assert isinstance(GpuUsage.text, object)
            print("Gpu Usage-2 : ", str(GpuUsage.text))
        sleep(340)
        # --------Elapsed Time -------------------
        myElem = self.driver1.find_element_by_id("elapsedTime")
        myElem.click()
        sleep(1)
        # --------Screen shot-2 -----------
        ss.ScreenShot(ss_path + "test_04_singlGpu_pgan_auto_elapsedeime1.png")
        sleep(2)
        assert isinstance(myElem.text, object)
        print("Pgan Auto-2 -", str(myElem.text))

        # gettime = self.driver1.find_elements_by_id("elapsedTime")

        try:
            for logs in driver1.get_log('browser'):
                print(logs)
            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))

        # ---------Logout ----------------
        self.driver1.find_element_by_id("navbarDropdownMenuLink").click()
        logout = self.driver1.find_element_by_class_name("dropdown-item")
        logout.click()
        sleep(5)
        for Logedout in self.driver1.find_elements_by_xpath(
                "//*[@class='alert alert-success']"):
            assert isinstance(Logedout.text, object)
            print(str(Logedout.text))
    def mnist_manual4(self):

        gpuper = "85"
        coreper = "90"
        driver2 = self.driver2
        myurl = Myurl(self.driver2)
        myurl.access_url()
        driver2.implicitly_wait(10)
        print("User-4 This is Title name :", driver2.title)
        sleep(40)
        # ------- Login Details ------------
        user = LoginUsers()
        Admin = user.user4_name
        Pwd = user.user4_password
        expected_username = user.user4_expadmin
        expected_password = user.user4_exppass
        # ------ local path ------------
        paths = Paths()
        locpath = paths.Local_path
        # ScreenShot Relative Path
        ss_path = '/Parallel/MultiUser_ParallelTest7/'
        # Creating object of screenshot utility
        ss = SS(driver2)
        sleep(5)
        user = self.driver2.find_element_by_name("username")
        user.send_keys(Admin)
        sleep(2)
        pwd = self.driver2.find_element_by_name("password")
        pwd.send_keys(Pwd)
        sleep(2)
        # self.driver2.find_element_by_class_name("btn btn-primary").click() ----this getting error
        # self.driver2.find_element_by_partial_link_text("Submit").click() ----this getting error--
        sub = self.driver2.find_element_by_tag_name("button")
        sub.click()
        for Logedout in self.driver2.find_elements_by_xpath(
                "//*[@class='alert alert-success']"):
            assert isinstance(Logedout.text, object)
            assert (print(str(Logedout.text)))
        if (Admin == expected_username and Pwd == expected_password):
            print("Login successful")
        else:
            assert (print("failed to login"))
        # print("Login Successfull")
        sleep(3)
        print("************ Mnist Manual *****************")
        # --------Frame work--------------
        # f = self.driver2.find_element_by_class_name("f-image mxnet text-center")
        f = self.driver2.find_element_by_xpath(
            "//img[@src='/images/tenserflow.png']")
        f.click()
        print("Selected Tensorflow")
        sleep(2)
        # --------if you have compound class name you should write like this-----------
        inception = self.driver2.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        inception.click()
        sleep(1)
        print("Selected Inception")

        # -----------local folder---------------
        local = self.driver2.find_element(By.ID, 'r100')
        local.click()
        sleep(1)
        localpath = self.driver2.find_element(By.ID, 'local_dir_path')
        localpath.send_keys(locpath)

        sleep(2)

        # ----------GPU Manual --------
        gpu = self.driver2.find_element(By.ID, 'r4')
        gpu.click()
        sleep(2)

        print("Your selected Manual")
        manual = self.driver2.find_element_by_id("r102")
        manual.click()
        sleep(1)
        # ------ gpu percentage -----------
        memory0 = self.driver2.find_element(By.ID, 'gpupercent0')
        memory0.send_keys(gpuper)
        print("User-4 gpu percentage : ", gpuper, '%')
        # --------core percentage -----------
        sleep(1)
        gpuvalue = self.driver2.find_element(By.ID, 'gpuvalue0')
        gpuvalue.send_keys(coreper)
        print("User-4 core percentage : ", coreper, '%')
        sleep(10)
        # ------Screenshot-1-----------
        ss.ScreenShot(ss_path +
                      "test_07_singleGpu_mnist_manual4_setupscreen4.png")
        # -------------------- setup btn -----------------
        setupbtn = self.driver2.find_element(By.ID, 'setupbtn')
        setupbtn.click()
        sleep(35)
        # it is pending waiting for user logout
        sleep(83)

        # -------Datsets & Training  ----------------
        traindir = self.driver2.find_element(By.ID, 'traindirectory')
        trdirectory = Select(traindir)
        trdirectory.select_by_visible_text("Mnist_classification")
        sleep(2)

        trinfile = self.driver2.find_element(By.ID, 'file_name')
        trfile = Select(trinfile)
        trfile.select_by_visible_text("mnist_gpu.py")
        sleep(2)
        #sleep(40)
        # --------- Train --------------------
        train = self.driver2.find_element_by_xpath("//a[@href='#train']")
        train.click()
        sleep(2)
        Train = self.driver2.find_element(By.ID, 'train_id')
        Train.click()
        sleep(20)
        gpuTime = driver2.find_elements_by_id("gputime")
        for GpuUsage in gpuTime:
            assert isinstance(GpuUsage.text, object)
            print("User-3 Gpu Usage : ", str(GpuUsage.text))
        sleep(30)

        # --------Elapsed Time -------------------
        myElem = self.driver2.find_element_by_id("elapsedTime")
        myElem.click()
        sleep(1)
        # ------Screenshot-2-----------
        ss.ScreenShot(ss_path +
                      "test_07_singleGpu_mnist_manual4_elapsedtime4.png")
        sleep(2)
        assert isinstance(myElem.text, object)
        print("User-4 Mnist Manual -", str(myElem.text))

        try:
            for logs in driver2.get_log('browser'):
                print(logs)
            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))
        # ---------Logout ----------------
        self.driver2.find_element_by_id("navbarDropdownMenuLink").click()
        logout = self.driver2.find_element_by_class_name("dropdown-item")
        logout.click()
        # print("Logout Successfull")
        sleep(5)
        for Logedout in self.driver2.find_elements_by_xpath(
                "//*[@class='alert alert-success']"):
            assert isinstance(Logedout.text, object)
            print(str(Logedout.text))
Beispiel #7
0
    def mnist_manual_01(self):
        # gpuper = "80"
        # coreper = "90"
        driver1 = self.driver1

        myurl = Myurl(self.driver1)
        myurl.access_url()
        driver1.implicitly_wait(10)
        print("This is Title name :", driver1.title)

        # ScreenShot Relative Path
        ss_path = '/Rvirtus/'
        # Creating object of screenshot utility
        ss = SS(driver1)

        # ------Memory and core Percentages ----------
        percentages = Memory_and_Core_Percentages()
        gpuper = percentages.memory_08
        coreper = percentages.core_08
        # ------- Login Details ------------
        user = LoginUsers()
        Admin = user.user1_name
        Pwd = user.user1_password
        expadmin = user.user1_expadmin
        exppass = user.user1_exppass
        # ------ local path ------------
        paths = Paths()
        locGVpath = paths.Local_GVirtus_path
        Backendip = paths.Backend_ip

        admin_login = AdminLogin(driver1)
        admin_login.set_login_uname(Admin)
        admin_login.set_login_upass(Pwd)
        sleep(3)
        admin_login.submit_login(Admin, Pwd)
        sleep(5)
        if Admin == expadmin and Pwd == exppass:
            print("Login successful")
        else:
            assert print("Invalid credentials")

        print("************ Mnist Manual *****************")
        # --------Frame work--------------
        f = self.driver1.find_element_by_xpath(
            "//img[@src='/images/tenserflow.png']")
        f.click()
        print("Selected Tensorflow")
        sleep(2)
        # --------if you have compound class name you should write like this-----------
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        inception.click()
        sleep(1)
        print("Selected Inception")

        # -----------local folder---------------
        local = self.driver1.find_element(By.ID, 'r100')
        local.click()
        sleep(1)
        localpath = self.driver1.find_element(By.ID, 'local_dir_path')
        localpath.send_keys(locGVpath)

        sleep(2)

        # ----------GPU Manual --------
        gpu = self.driver1.find_element(By.ID, 'r4')
        gpu.click()
        sleep(2)

        print("Your selected Manual")
        manual = self.driver1.find_element_by_id("r102")
        manual.click()
        sleep(1)
        # ---------Backend IP --------------
        '''backendip = self.driver1.find_element(By.ID, 'gpuip0')
        backendip.clear()
        sleep(1)
        backendip.send_keys(Backendip)
        '''
        # ------ gpu percentage -----------
        memory0 = self.driver1.find_element(By.ID, 'gpupercent0')
        memory0.send_keys(gpuper)
        print("gpu percentage : ", gpuper, '%')
        # --------core percentage -----------
        sleep(1)
        gpuvalue = self.driver1.find_element(By.ID, 'gpuvalue0')
        gpuvalue.send_keys(coreper)
        print("core percentage : ", coreper, '%')
        sleep(4)
        # ------Screenshot-1-----------
        ss.ScreenShot(ss_path +
                      "test_parallel_04_mnist_manual1_setupscreen.png")
        # -------------------- setup btn -----------------
        setupbtn = self.driver1.find_element(By.ID, 'setupbtn')
        setupbtn.click()
        sleep(25)

        # -------Datsets & Training  ----------------
        traindir = self.driver1.find_element(By.ID, 'traindirectory')
        trdirectory = Select(traindir)
        trdirectory.select_by_visible_text("Mnist_classification")
        sleep(2)

        trinfile = self.driver1.find_element(By.ID, 'file_name')
        trfile = Select(trinfile)
        trfile.select_by_visible_text("mnist_deep.py")
        sleep(2)
        # --------- Train --------------------
        train = self.driver1.find_element_by_xpath("//a[@href='#train']")
        train.click()
        sleep(2)
        Train = self.driver1.find_element(By.ID, 'train_id')
        Train.click()
        sleep(30)
        gpuTime = driver1.find_elements_by_id("gputime")
        for GpuUsage in gpuTime:
            assert isinstance(GpuUsage.text, object)
            print("Gpu Usage : ", str(GpuUsage.text))
        sleep(80)

        # --------Elapsed Time -------------------
        myElem = self.driver1.find_element_by_id("elapsedTime")
        myElem.click()
        sleep(1)
        # ------Screenshot-2-----------
        ss.ScreenShot(ss_path +
                      "test_parallel_03_mnist_manual1_elapsedtime.png")
        sleep(2)
        assert isinstance(myElem.text, object)
        print("Mnist Manual -", str(myElem.text))

        try:
            pass

            # log = self.get_browser_console_log()
            # log = self.driver1.get_log(browser)
            # print("Console Log: ",log)
        except Exception as e:
            print("Exception Occurred :" + str(e))
        # ---------Logout ----------------
        self.driver1.find_element_by_id("navbarDropdownMenuLink").click()
        logout = self.driver1.find_element_by_class_name("dropdown-item")
        logout.click()
        sleep(5)
        for Logedout in self.driver1.find_elements_by_xpath(
                "//*[@class='alert alert-success']"):
            assert isinstance(Logedout.text, object)
            print(str(Logedout.text))
Beispiel #8
0
    def test_09_Valid_Nfs(self):
        driver1 = self.driver1

        sysip = "52.32.163.231"
        myurl = Myurl(self.driver1)
        myurl.access_url()
        #self.driver1.get("http://35.165.255.128:3010/users/login")
        sleep(2)

        cookies = pickle.load(open("cookies.pkl", "rb"))
        # print("get cookie vlaues ", cookies)
        sleep(1)
        for cookie_dict in cookies:
            driver1.add_cookie(cookie_dict)
            # print("this is for loop")
        #self.driver1.get("http://35.165.255.128:3010/accessUI/5c7e501310ec7c705d33423c")
        myurl.acces_user()

        raptui = RaptUi(driver1)
        raptui.T_Flow()
        print("Selected Tensorflow")
        sleep(1)
        # tensorflow.inception()
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        # inception = self.driver1.find_elements_by_xpath("(//*[@class='card border border-primary'])[0]")
        inception.click()
        sleep(1)
        raptui.Nfs()

        path = "/home/ubuntu/tensorflow-UI"
        print("Nfs selected")
        raptui.NfsSysIp(sysip)
        sleep(1)
        raptui.NfsPath(path)
        sleep(1)
        raptui.Gpu()
        sleep(1)
        raptui.Auto()
        sleep(1)
        print("Your selected Auto")
        raptui.Setupbtn()
        sleep(23)
        traindir = self.driver1.find_element(By.ID, 'traindirectory')
        trdirectory = Select(traindir)
        trdirectory.select_by_visible_text("Mnist_classification")
        sleep(2)
        trinfile = self.driver1.find_element(By.ID, 'file_name')
        trfile = Select(trinfile)
        trfile.select_by_visible_text("mnist_gpu.py")
        sleep(2)
        raptui.Train()
        sleep(2)
        # textpath = self.driver1.find_element_by_id("textVal")
        # textpath.clear()
        # flowerpath = "python /s3mount/tensorflow-UI-less/training/flower_classification/retrain-new.py --model_dir=/s3mount/tensorflow-UI-less/inception --image_dir /s3mount/tensorflow-UI-less/datasets/flower_photos --bottleneck_dir=/s3mount/tensorflow-UI-less/datasets/bottlenecks-new --how_many_training_steps 50"
        # textpath.send_keys(flowerpath)
        sleep(2)
        raptui.TrainButton()
        sleep(30)
        gpuTime = driver1.find_elements_by_id("gputime")
        for GpuUsage in gpuTime:
            assert isinstance(GpuUsage.text, object)
            print("Gpu Usage : ", str(GpuUsage.text))
        sleep(30)
        # --------Elapsed Time -------------------
        myElem = self.driver1.find_element_by_id("elapsedTime")
        myElem.click()
        sleep(2)
        assert isinstance(myElem.text, object)
        print("Mnist Auto -", str(myElem.text))
        try:
            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))
Beispiel #9
0
    def test_01_Invalid_localdirpath(self):
        driver1 = self.driver1
        memory = "60"
        core = "90"

        myurl = Myurl(self.driver1)
        myurl.access_url()
        sleep(2)

        cookies = pickle.load(open("cookies.pkl", "rb"))
        # print("get cookie vlaues ", cookies)
        sleep(1)
        for cookie_dict in cookies:
            driver1.add_cookie(cookie_dict)
            # print("this is for loop")
        #self.driver1.get("http://54.191.212.159:3020/accessUI/5c7e501310ec7c705d33423c")
        myurl.acces_user()

        raptui = RaptUi(driver1)
        raptui.T_Flow()
        print("Selected Tensorflow")
        sleep(1)
        # tensorflow.inception()
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        # inception = self.driver1.find_elements_by_xpath("(//*[@class='card border border-primary'])[0]")
        inception.click()
        sleep(1)

        raptui.Localfolder()
        path = "/mnt/rapt/tensorflow"
        exppath = "/mnt/rapt/tensorflow-UI"
        sleep(1)
        raptui.set_localpath(path)
        sleep(1)
        print("Your given path ", path)
        self.assertEqual(exppath, path, "Invalid local directory path")
        raptui.Gpu()
        sleep(1)
        raptui.Auto()
        sleep(1)
        print("Your selected Auto")

        memoryper = self.driver1.find_element(By.ID, 'gpupercent0')

        memoryper.send_keys(memory)
        sleep(2)
        print("Memory percentage :", memory)
        coreper = self.driver1.find_element(By.ID, 'gpuvalue0')
        coreper.send_keys(core)
        sleep(2)
        print("Core percentage :", core)
        raptui.Setupbtn()
        sleep(5)
        # -------- Alert start ----------------
        # Switch the control to the Alert window
        obj = driver1.switch_to.alert
        sleep(2)
        # Retrieve the message on the Alert window
        msg = obj.text
        print("Alert shows following message: " + msg)
        sleep(2)
        # use the accept() method to accept the alert
        obj.accept()
        sleep(5)
        # ------------ Alert end -------------
        try:

            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))