def test_05_empty_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 = "" 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))
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))
def test_08_Valid_S3_Bucket(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 = "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(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))