コード例 #1
0
ファイル: DateView.py プロジェクト: eidan76/Web-Automation1
 def select_day(self, today):
     Config.find_element(Config.cal_selectedDay).get_attribute("data-full")
     today = today.split("-")
     today = datetime.date(int(today[0]), int(today[1]) + 1, int(today[2]))
     x = datetime.timedelta(2)
     xDate = today + x
     return str(xDate.year) + "-" + str(xDate.month - 1) + "-" + str(xDate.day)
コード例 #2
0
    def test(self):
        self.verificationErrors = []

        Config.find_element(Config.openSettings).click()
        time.sleep(1)
        user = Config.find_element(Config.settings_email).text

        InitCase.init_case(menu="ALL", view="date")

        sender = Config.get_sender()
        receiver = Config.get_receiver()

        sections = ["Tomorrow", "Upcoming", "Someday"]
        for i in range(3):
            sec = random.choice(sections)
            ActionChains(Config.get_driver()).drag_and_drop(Config.find_element(Config.task), Config.find_element(Config.list_sectionByName, sec)).perform()
            sections.remove(sec)
            Config.sync()

            if user == receiver: user = sender
            else: user = receiver
            ChangeUser.change_user(user)

            InitCase.init_case(menu="ALL", view="date")
            try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, sec))
            except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #3
0
    def test(self):
        InitCase.init_case(menu="MAIN")
        self.verificationErrors = []
        listID = NewList.listID

        list = Config.find_element(Config.main_listByID, listID)
        allTasks = Config.find_element(Config.main_AllTasks)

        #~Drag and Drop~
        ActionChains(Config.get_driver()).click_and_hold(list).perform()
        time.sleep(0.5)
        ActionChains(Config.get_driver()).move_to_element_with_offset(allTasks, 238, 0).perform()
        time.sleep(0.5)
        ActionChains(Config.get_driver()).release().perform()
        time.sleep(1)

        style = list.get_attribute("style")
        left = style.find("left: ") + 6
        position = ""
        for i in range(3):
            position = position + style[left]
            left = left + 1

        try: self.assertEqual("238", position)
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #4
0
ファイル: Main.py プロジェクト: Pierroley/pandora-public
def main():
    ## Take care of output folders
    if not os.path.exists(c.PATH_RESOURCES + "\\" + c.OUT_FOLDER):
        os.mkdir(c.PATH_RESOURCES + "\\" + c.OUT_FOLDER)
        
    if not os.path.exists(c.PATH_RESOURCES + "\\" + c.OUT_FOLDER + "\\" + c.CURRENT_CONDITION[1]):
        os.mkdir(c.PATH_RESOURCES + "\\" + c.OUT_FOLDER + "\\" + c.CURRENT_CONDITION[1])
    
    
    ## parse acmi file
    f = open(c.PATH_RESOURCES + "\\" + c.ACMI_FILE)
    s = f.read()
    flights = r.GetFlightsIDs(s)
    start_tstp = datetime.strptime(r.GetInitialTimestamp(s[0:500]), '%Y-%m-%dT%H:%M:%SZ')
    f.close()
    
    ## init dictionaries used for consistency across run
    c.InitDicoAircrafts()
    c.InitAirSpeed()
    
    ## process every records
    records = r.GetRecords(s)
    for f_id, f_name in flights:
        f_name = f_name.split(" ")[0]
        if f_name in ["A-10A"]:
            continue
        print("creating file for " + f_id + "_" + f_name)
        fg.GenerateFile(f_id, f_name, records, start_tstp)
        pass
コード例 #5
0
ファイル: Game.py プロジェクト: 3a-arthurkevin/CardGame
 def saveDeck(self, player):
     """
     Sauvegarde du deck dans le fichier de configuration
     Le deck sauvegardé est associé à un nom
     Si le nom est déjà présent dans le fichier de configuration le deck est écrasé 
     """
     
     if len(player.cardsList) < Player.totalCardIntoDeck:
         print("Le nombre de carte dans le deck du joueur n'est pas suffisant")
         return False
     
     cardList = [ card.idCard for card in player.cardsList ]
     deckName = input("Choisissez le nom de votre deck : ")
     decks = self.config["Decks"]
     
     deck = [ deck for deck in decks if deck["Name"] == deckName ]
     
     if len(deck) <= 0:
         decks.append({"Name":deckName, "CardList" : cardList})
     else:
         deck[0]["CardList"] = cardList
     
     Config.saveConfig(self.config)
     
     return True
コード例 #6
0
 def other_user(self):
     u1 = Config.get_receiver()
     u2 = Config.get_sender()
     if self.user == u1:
         return u2
     else:
         return u1
コード例 #7
0
    def test(self):
        taskID = InitCase.init_case(menu="ALL", view="priority")
        self.verificationErrors = []

        ActionChains(Config.get_driver()).drag_and_drop(Config.find_element(Config.taskByID, taskID), Config.find_element(Config.list_sectionByName, "Normal")).perform()

        try: self.assertFalse(Config.is_element_present(Config.taskPriority))
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #8
0
ファイル: lan.py プロジェクト: JerzySpendel/LanTransfer
    def save(self):
        threads = self.general.ui.horizontalSlider.sliderPosition()
        chunksize = self.general.ui.lineEdit.text()
        downspeed = self.network.ui.lineEdit_2.text()
        upspeed = self.network.ui.lineEdit_3.text()

        #Saving each property to file :)
        Config.changeProperty('THREADS', threads)
        Config.changeProperty('CHUNK_SIZE', chunksize)
        Config.changeProperty('DOWNLOAD_MAX',downspeed)
        Config.changeProperty('UPLOAD_MAX', upspeed)

        Config.saveContacts(self.general.ui.plainTextEdit.toPlainText())
        self.hide()
コード例 #9
0
ファイル: Edit.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="subtasks")
        self.verificationErrors = []

        Config.find_element(Config.subtasks_title).click()
        Config.find_element(Config.subtasks_title).clear()
        Config.find_element(Config.subtasks_title).send_keys("edited")
        Config.find_element(Config.task_badgeByIconName, "subtasks").click()

        try: self.assertEqual("edited",  Config.find_element(Config.subtasks_title).text)
        except AssertionError as e: self.verificationErrors.append(str(e))
コード例 #10
0
ファイル: Main.py プロジェクト: engelvinter/TacticalX
def mom_rel():
    log_name = "mom_rel_{}".format(datetime.now().strftime("%Y-%m-%d_%H_%M_%S"))
    
    c = Config()
    c.log_name = log_name
    c.name = "momentum rel"
    c.def_alloc = {'SEB Europafond' : 0.5, 'SEB Världenfond' : 0.5 }
    c.funds = funds
    c.algo = "mom_rel"
    c.freq = MONTHLY
    c.start = "2000-02-26"
    c.end = "2017-10-30"

    ts = backtest(c)
    return ts
コード例 #11
0
ファイル: Unswipe.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="subtasks")
        self.verificationErrors = []

        Config.find_element(Config.subtasks_title).click()
        time.sleep(1)

        #Check badge
        try: self.assertEqual("1", Config.find_element(Config.task_badgeByIconName, "subtasks").get_attribute("data-badge"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        #Check task status
        try: self.assertEqual("unchecked", Config.find_element(Config.subtask).get_attribute("data-status"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #12
0
    def test(self):
        taskID = InitCase.init_case(menu="ALL", view="priority", taskOption="open")
        self.verificationErrors = []

        Config.wait_for_element(Config.task_PrioritySelector)
        Config.find_element(Config.task_PrioritySelector).click()
        time.sleep(2)
        Config.find_element(Config.task_closeButton).click()
        Config.wait_for_element(Config.task_closeButton, present=False)

        try: self.assertEqual(Config.find_element(Config.taskBySectionName, "High").get_attribute("data-task-id"),taskID)
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual([], self.verificationErrors)
コード例 #13
0
ファイル: EditNote.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(taskOption="note")
        self.verificationErrors = []
        noteText = "edit edit edit edit"
        Config.find_element(Config.note).clear()
        Config.find_element(Config.note).send_keys(noteText)

        try: self.assertEqual(" ", Config.find_element(Config.task_badgeByIconName, "note").get_attribute("data-badge"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.task_closeButton).click()
        Config.wait_for_element(Config.task_closeButton, present=False)
        InitCase.task_options("note")

        time.sleep(1)
        try: self.assertEqual(noteText, Config.find_element(Config.note).text)
        except AssertionError as e: self.verificationErrors.append(str(e))
コード例 #14
0
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="open")
        self.verificationErrors = []

        Config.wait_for_element(Config.task_PrioritySelector)
        Config.find_element(Config.task_PrioritySelector).click()
        time.sleep(2)
        Config.find_element(Config.task_closeButton).click()
        Config.wait_for_element(Config.task_closeButton, present=False)

        try: self.assertTrue(Config.is_element_present(Config.taskPriority))
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #15
0
    def test(self):
        InitCase.init_case(menu="ALL", view="priority", taskNo=0)
        self.verificationErrors = []

        CreateTaskF.create_a_task("priHigh", "High")

        try: self.assertTrue(Config.is_element_present(Config.taskPriority))
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual([], self.verificationErrors)
コード例 #16
0
ファイル: Delete.py プロジェクト: eidan76/Web-Automation1
    def test(self):

        InitCase.init_case(menu="ALL", taskNo=0)
        self.verificationErrors = []

        try: self.assertFalse(Config.is_element_present(Config.task))
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #17
0
    def test(self):
        InitCase.init_case(menu="MAIN")
        self.verificationErrors = []
        listID = NewList.listID

        ActionChains(Config.get_driver()).move_to_element(Config.find_element(Config.main_listByID, listID)).perform()
        time.sleep(1)

        Config.find_element(Config.main_listOptionsID, listID).click()
        Config.find_element(Config.main_listDeleteID, listID).click()
        time.sleep(1)
        Config.find_element(Config.listDeleteConfirm).click()
        try: self.assertFalse(Config.is_element_present(Config.main_listByID, listID))
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual([], self.verificationErrors)
コード例 #18
0
ファイル: lan.py プロジェクト: JerzySpendel/LanTransfer
 def setIp(self,index):
     name = index.data(Qt.DisplayRole)
     ip = None
     for contact in Config.openContacts():
         if contact[1] == name:
             ip = contact[0]
     if ip is not None:
         self.ui.lineEdit.setText(ip)
     else:
         print('Couldn\'t get ip')
コード例 #19
0
ファイル: NewList.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="MAIN")
        self.verificationErrors = []

        listName = "x"
        Config.find_element(Config.main_newList).click()
        Config.find_element(Config.listTitleEdit).send_keys(listName)
        Config.find_element(Config.listTitleEdit).send_keys(Keys.ENTER)

        try: Config.is_element_present(Config.main_listByName, listName)
        except AssertionError as e: self.verificationErrors.append(str(e))

        global listID
        listID = Config.find_element(Config.main_listByName, listName).get_attribute("id")

        self.assertEqual([], self.verificationErrors)
コード例 #20
0
    def test(self):
        taskID = InitCase.init_case(menu="ALL", view="date")
        self.verificationErrors = []

        ActionChains(Config.get_driver()).drag_and_drop(Config.find_element(Config.taskByID, taskID), Config.find_element(Config.list_sectionByName, "Someday")).perform()
        Config.find_element(Config.taskTitleID, taskID).click()

        try: Config.find_element(Config.task_TimeSelector).text.index("Someday")
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.task_closeButton).click()

        self.assertEqual([], self.verificationErrors)
コード例 #21
0
ファイル: CreateTask.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", view="date", taskNo=0)
        self.verificationErrors = []

        global taskID
        taskID = CreateTaskF.create_a_task("test", "Today")

        try: self.assertEqual("test", Config.find_element(Config.taskTitleID, taskID).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        # after test case is complete, all the 'verify' commands that have failed are raised
        self.assertEqual([], self.verificationErrors)
コード例 #22
0
    def test(self):
        driver = Config.get_driver()
        self.verificationErrors = []

        listID = Config.find_element(Config.main_listByName, "POS").get_attribute("id")
        taskIDs = InitCase.init_case(menu=listID, view="clean", taskNo=5)

        for i in range(3):
            n = Config.find_element(Config.taskTitleID, random.choice(taskIDs))
            ActionChains(driver).drag_and_drop_by_offset(n, 0, 90).perform()
        newOrder = Config.find_elements(Config.task)
        newOrderIDs = []
        for t in newOrder:
            newOrderIDs.append(t.get_attribute("data-task-id"))

        mainWindow = driver.current_window_handle
        driver.execute_script("$(window.open())")
        window2 = driver.window_handles
        window2.remove(mainWindow)
        driver.switch_to_window(window2)
        driver.get(Config.get_base_url())

        InitCase.init_case(menu="ALL", view="clean", taskNo=5)

        platform2Order = Config.find_elements(Config.task)

        for t in range(len(platform2Order)):
            try: self.assertEqual(platform2Order[t].get_attribute("data-task-id"), newOrderIDs[t])
            except AssertionError as e: self.verificationErrors.append(str(e))

        driver.close()
        driver.switch_to_window(mainWindow)
コード例 #23
0
ファイル: Add.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="subtasks")
        self.verificationErrors = []

        Config.find_element(Config.subtasks_newTitle).clear()
        Config.find_element(Config.subtasks_newTitle).send_keys("subtask")
        Config.find_element(Config.subtasks_plusButton).click()

        #Check subtasks badge = 1
        try: self.assertEqual("1", Config.find_element(Config.task_badgeByIconName, "subtasks").get_attribute("data-badge"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        try: self.assertEqual("subtask",  Config.find_element(Config.subtasks_title).text)
        except AssertionError as e: self.verificationErrors.append(str(e))
コード例 #24
0
ファイル: ChangeList.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="open")
        self.verificationErrors = []

        Config.find_element(Config.task_FolderSelector).click()
        x = Config.find_element(Config.task_ListSelectorItem).text
        Config.find_element(Config.task_ListSelectorItem).click()

        try: self.assertEqual(x, Config.find_element(Config.task_FolderSelector).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.task_closeButton).click()

        self.assertEqual([], self.verificationErrors)
コード例 #25
0
    def test(self):
        taskID = InitCase.init_case(menu="ALL", view="date", taskOption="open")
        self.verificationErrors = []


        Config.find_element(Config.task_TimeSelector).click()

        #Find what it the selected day in the date selector and select the date 2 days from then
        today = Config.find_element(Config.cal_selectedDay).get_attribute("data-full")
        today = today.split("-")
        today = datetime.date(int(today[0]), int(today[1]) + 1, int(today[2]))
        x = datetime.timedelta(2)
        xDate = today + x
        selectDay = str(xDate.year) + "-" + str(xDate.month - 1) + "-" + str(xDate.day)

        Config.find_element(Config.cal_dayByDate, selectDay).click()
        Config.find_element(Config.cal_OK).click()

        Config.find_element(Config.task_closeButton).click()
        try: self.assertEqual(taskID, Config.find_element(Config.taskBySectionName, "Upcoming").get_attribute("data-task-id"))
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual([], self.verificationErrors)
コード例 #26
0
ファイル: ChangeUser.py プロジェクト: eidan76/Web-Automation1
def change_to_premium(isPremium=False):
    if isPremium == False: isPremium = "Free Account"
    else: isPremium = "Premium Account"
    Config.find_element(Config.openSettings).click()
    time.sleep(1)
    if Config.find_element(Config.settings_accountStatus).text == isPremium:
        if isPremium == "Free Account": change_user("*****@*****.**")
        else: change_user()

    else:
        Config.find_element(Config.overlay).click()
        Config.wait_for_element_visibility(Config.overlay, visible=False)
コード例 #27
0
ファイル: Game.py プロジェクト: 3a-arthurkevin/CardGame
    def __init__(self, params):
        '''
        Initialisation d'une partie
        Création des player
        '''
        self.useGoto = False
        self.config = Config.loadConfig()
        self.cards = []
        self.setupCard()

        self.players = [Player(params.get("playerName1")), Player(params.get("playerName2"))]
        
        self.setupPlayer(self.players[0])
        self.setupPlayer(self.players[1])
        self.setupDeck()
コード例 #28
0
ファイル: Delete.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="subtasks")
        self.verificationErrors = []

        Config.find_element(Config.subtasks_check).click()
        Config.wait_for_element_visibility(Config.subtasks_markDone)
        Config.find_element(Config.subtasks_markDone).click()

        #Check badge
        try: self.assertEqual("0", Config.find_element(Config.task_badgeByIconName, "subtasks").get_attribute("data-badge"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        #Check no subtasks present
        try: self.assertFalse(Config.is_element_present(Config.subtask))
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #29
0
    def test(self, listID = None):
        self.verificationErrors = []
        if listID is None:
            listID = NewList.listID
        InitCase.init_case(menu=listID, taskNo=None)

        Config.find_element(Config.menuButton).click()
        Config.find_element(Config.menu_deleteList).click()
        time.sleep(1)
        Config.find_element(Config.listDeleteConfirm).click()
        time.sleep(2)
        try: self.assertFalse(Config.is_element_present(Config.main_listByID, listID))
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual([], self.verificationErrors)
コード例 #30
0
ファイル: SignIn.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        self.verificationErrors = []
        ChangeUser.change_user("*****@*****.**")

        time.sleep(5)
        try: self.assertFalse(Config.is_element_present(Config.signUp_start))
        except AssertionError as e: self.verificationErrors.append(e)

        Config.wait_for_element(Config.main_hayush)
        try: self.assertEqual(Config.find_element(Config.main_hayush).text, "HI AUTLOGIN")
        except AssertionError as e: self.verificationErrors.append(e)

        Config.find_element(Config.openSettings).click()
        time.sleep(1)
        try: self.assertEqual(Config.find_element(Config.settings_email).text, "*****@*****.**")
        except AssertionError as e: self.verificationErrors.append(e)
コード例 #31
0
ファイル: AddNote.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="note")
        self.verificationErrors = []
        noteText = "test test test test test test test test test test test test test test test test test test test test test test "
        Config.find_element(Config.note).send_keys(noteText)

        try: self.assertEqual(" ", Config.find_element(Config.task_badgeByIconName, "note").get_attribute("data-badge"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.task_closeButton).click()
        InitCase.task_options("note")

        try: self.assertEqual(noteText, Config.find_element(Config.note).text)
        except AssertionError as e: self.verificationErrors.append(str(e))
コード例 #32
0
ファイル: AddVideo.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="files")
        self.verificationErrors = []

        Config.find_element(Config.files_addFromComputer).send_keys("C:\\Users\\Eidan Wasser\\PycharmProjects\\Suite1\\Files\\vid.mp4")
        Config.wait_for_element(Config.files_progressBar, present=False)

        try: self.assertEqual("vid.mp4", Config.find_element(Config.files_name).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        try: self.assertTrue(Config.is_element_present(Config.files_thumbnailByType, "video"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        #Check files badge = 1
        try: self.assertEqual("1", Config.find_element(Config.task_badgeByIconName, "files").get_attribute("data-badge"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #33
0
    ## Take care of output folders
    if not os.path.exists(c.PATH_RESOURCES + "\\" + c.OUT_FOLDER):
        os.mkdir(c.PATH_RESOURCES + "\\" + c.OUT_FOLDER)

    if not os.path.exists(c.PATH_RESOURCES + "\\" + c.OUT_FOLDER + "\\" +
                          c.CURRENT_CONDITION[1]):
        os.mkdir(c.PATH_RESOURCES + "\\" + c.OUT_FOLDER + "\\" +
                 c.CURRENT_CONDITION[1])

    ## parse acmi file
    f = open(c.PATH_RESOURCES + "\\" + c.ACMI_FILE)
    s = f.read()
    flights = r.GetFlightsIDs(s)
    print(flights)
    start_tstp = datetime.strptime(r.GetInitialTimestamp(s[0:500]),
                                   '%Y-%m-%dT%H:%M:%SZ')
    f.close()

    ## init dictionaries used for consistency across run
    c.InitDicoAircrafts()
    c.InitAirSpeed()

    ## process every records
    records = r.GetRecords(s)
    for f_id, f_name in flights:
        f_name = f_name.split(" ")[0]
        if f_name in ["A-10A"]:
            continue
        print("creating file for " + f_id + "_" + f_name)
        fg.GenerateFile(f_id, f_name, records, start_tstp)
        pass