Ver Fonte

feat(Quiz): Done

huangrunheng há 2 anos atrás
pai
commit
231bac8dca

+ 1 - 1
module/config/config_manual.py

@@ -18,7 +18,7 @@ class ConfigManual:
         > TrueOrochi > RichMan
         > TrueOrochi > RichMan
         > CollectiveMissions
         > CollectiveMissions
         > Pets > TalismanPass > SoulsTidy > Delegation > Hyakkiyakou
         > Pets > TalismanPass > SoulsTidy > Delegation > Hyakkiyakou
-        > Secret > WeeklyTrifles > MysteryShop > Duel > MetaDemon > FrogBoss > FloatParade
+        > Secret > WeeklyTrifles > MysteryShop > Duel > MetaDemon > FrogBoss > FloatParade > Quiz
         """
         """
 
 
     DEVICE_OVER_HTTP = False
     DEVICE_OVER_HTTP = False

+ 1 - 1
module/config/config_menu.py

@@ -33,7 +33,7 @@ class ConfigMenu:
         # 每周任务
         # 每周任务
         self.menu["Weekly Task"] = ['TrueOrochi', 'RichMan', 'Secret', 'WeeklyTrifles', 'MysteryShop', 'Duel']
         self.menu["Weekly Task"] = ['TrueOrochi', 'RichMan', 'Secret', 'WeeklyTrifles', 'MysteryShop', 'Duel']
         # 活动的任务
         # 活动的任务
-        self.menu["Activity Task"] = ['ActivityShikigami', 'MetaDemon', 'FrogBoss', 'FloatParade']
+        self.menu["Activity Task"] = ['ActivityShikigami', 'MetaDemon', 'FrogBoss', 'FloatParade', 'Quiz']
         # 开发工具
         # 开发工具
         self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule', 'List Rule']
         self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule', 'List Rule']
 
 

+ 2 - 0
module/config/config_model.py

@@ -51,6 +51,7 @@ from tasks.ActivityShikigami.config import ActivityShikigami
 from tasks.MetaDemon.config import MetaDemon
 from tasks.MetaDemon.config import MetaDemon
 from tasks.FrogBoss.config import FrogBoss
 from tasks.FrogBoss.config import FrogBoss
 from tasks.FloatParade.config import FloatParade
 from tasks.FloatParade.config import FloatParade
+from tasks.Quiz.config import Quiz
 # ----------------------------------------------------------------------------------------------------------------------
 # ----------------------------------------------------------------------------------------------------------------------
 
 
 # 肝帝专属---------------------------------------------------------------------------------------------------------------
 # 肝帝专属---------------------------------------------------------------------------------------------------------------
@@ -107,6 +108,7 @@ class ConfigModel(ConfigBase):
     meta_demon: MetaDemon = Field(default_factory=MetaDemon)
     meta_demon: MetaDemon = Field(default_factory=MetaDemon)
     frog_boss: FrogBoss = Field(default_factory=FrogBoss)
     frog_boss: FrogBoss = Field(default_factory=FrogBoss)
     float_parade: FloatParade = Field(default_factory=FloatParade)
     float_parade: FloatParade = Field(default_factory=FloatParade)
+    quiz: Quiz = Field(default_factory=Quiz)
 
 
     # 这些是肝帝专属
     # 这些是肝帝专属
     bondling_fairyland: BondlingFairyland = Field(default_factory=BondlingFairyland)
     bondling_fairyland: BondlingFairyland = Field(default_factory=BondlingFairyland)

+ 84 - 22
tasks/DemonEncounter/data/answer.py

@@ -2,36 +2,98 @@
 # @author runhey
 # @author runhey
 # github https://github.com/runhey
 # github https://github.com/runhey
 import csv
 import csv
+import re
 
 
 from datetime import datetime
 from datetime import datetime
 from pathlib import Path
 from pathlib import Path
 
 
+from module.logger import logger
 
 
-def answer_one(question: str, options: list[str]) -> int:
-    """
+def count_intersection(str1, str2):
+    set1 = set(str1)
+    set2 = set(str2)
+    intersection = set1.intersection(set2)
+    return len(intersection)
 
 
-    每一个问题有四个选项, 返回选项的序号(1、2、3)
-    :param question:
-    :param options:
-    :return:
-    """
-    file = str(Path(__file__).parent / 'data.csv')
-    with open(file, newline='', encoding='utf-8-sig') as csvfile:
-        reader = csv.reader(csvfile)
-        next(reader)
-        for row in reader:
-            if row[0] == question:
-                try:
-                    return options.index(row[1]) + 1
-                except ValueError:
-                    return 1
-        return 1
+def remove_symbols(text):
+    return re.sub(r'[^\w\s]', '', text)
+
+class Answer:
+    def __init__(self):
+        self.data: dict[str, list] = {}
+        self.data_options: dict[str, list] = {}
+        file = str(Path(__file__).parent / 'data.csv')
+        with open(file, newline='', encoding='utf-8-sig') as csvfile:
+            reader = csv.reader(csvfile)
+            next(reader)
+            for row in reader:
+                key = remove_symbols(row[0])
+                value = remove_symbols(row[1])
+                if key not in self.data:
+                    self.data[key] = []
+                self.data[key].append(value)
+                if value not in self.data_options:
+                    self.data_options[value] = []
+                self.data_options[value].append(key)
+
+    def answer_one(self, question: str, options: list[str]) -> int|None:
+        """
+
+        每一个问题有三个选项, 返回选项的序号(1、2、3)
+        :param question:
+        :param options:
+        :return:
+        """
+        def decide_by_options(question: str, option: list[str]):
+            # 瞎猫当死耗子
+            opts = {}
+            for index, option in enumerate(options):
+                if option in self.data_options.keys():
+                    cnts = [count_intersection(question, ques) for ques in self.data_options[option] ]
+                    cnts.sort(reverse=True)
+                    opts[index + 1] = cnts[0]
+            #
+            if opts:
+                opts = sorted(opts.items(), key=lambda x: x[1], reverse=True)
+            if opts:
+                return opts[0][0]
+            else:
+                return None
+
+
+        question = question.replace('「', '').replace('」', '').replace('?', '')
+        question = remove_symbols(question)
+        options = [remove_symbols(option) for option in options]
+
+        for index, option in enumerate(options):
+            if option == '其余选项皆对':
+                return index + 1
+
+        question_matches: list = []
+        try:
+            question_matches = self.data[question]
+        except Exception as e:
+            # 没有出现题目,从选项反入手
+            logger.error('Exception: %s', e)
+            return decide_by_options(question=question, option=options)
+        # 出现了题目,开始对答案
+        for index, option in enumerate(options):
+            for match in question_matches:
+                if match == option:
+                    return index + 1
+        # 选项一个都对不上可能是,识别的选项异常
+        for index, option in enumerate(options):
+            if option == '':
+                logger.error('Option is empty: %s', options)
+                return index + 1
+        return None
 
 
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
-    question = '以下式神中,手持折扇的是'
-    options = ['生命上限', '鬼王', '荒川之主']
+    answer = Answer()
+    question = '以下式神中,谁从小就是孤'
+    options = ['生命上限', '小鹿男', '荒川之主']
     start_time = datetime.now()
     start_time = datetime.now()
-    print(answer_one(question, options))
+    print(answer.answer_one(question, options))
+    print(answer.answer_one(question, options))
     print(datetime.now() - start_time)
     print(datetime.now() - start_time)
-    print(answer_one(question, options))

Diff do ficheiro suprimidas por serem muito extensas
+ 757 - 757
tasks/DemonEncounter/data/data.csv


+ 12 - 1
tasks/DemonEncounter/data/extract_to_csv.py

@@ -6,6 +6,7 @@ import rich
 import csv
 import csv
 import pandas as pd
 import pandas as pd
 
 
+from utils import remove_symbols
 
 
 class Extracter:
 class Extracter:
     def __init__(self, data_file: str='data.csv'):
     def __init__(self, data_file: str='data.csv'):
@@ -71,9 +72,12 @@ class Extracter:
             if len(question) < 3:
             if len(question) < 3:
                 continue
                 continue
             # print(index, question, answer)
             # print(index, question, answer)
+            # 非常重要,去除标点符号
+            question = remove_symbols(question)
+            answer = remove_symbols(answer)
             if self.appear_in_df(question, answer):
             if self.appear_in_df(question, answer):
                 continue
                 continue
-            # print(index, question, answer)
+            print('New', index, question, answer)
             self.df.loc[index] = [question, answer]
             self.df.loc[index] = [question, answer]
         self.df.to_csv(self.data_file, index=False, encoding='utf-8-sig')
         self.df.to_csv(self.data_file, index=False, encoding='utf-8-sig')
 
 
@@ -83,6 +87,13 @@ class Extracter:
                 return True
                 return True
         return False
         return False
 
 
+    def clear_symbols(self):
+        for index, row in self.df.iterrows():
+            row['question'] = remove_symbols(row['question'])
+            row['answer'] = remove_symbols(row['answer'])
+        self.df.to_csv(self.data_file, index=False, encoding='utf-8-sig')
+
+
 
 
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":

+ 8 - 0
tasks/DemonEncounter/data/utils.py

@@ -0,0 +1,8 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+import re
+
+
+def remove_symbols(text):
+    return re.sub(r'[^\w\s]', '', text)

+ 4 - 2
tasks/DemonEncounter/script_task.py

@@ -16,7 +16,7 @@ from tasks.GameUi.page import page_main, page_demon_encounter
 from tasks.DemonEncounter.assets import DemonEncounterAssets
 from tasks.DemonEncounter.assets import DemonEncounterAssets
 from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
-from tasks.DemonEncounter.data.answer import answer_one
+from tasks.DemonEncounter.data.answer import Answer
 
 
 class LanternClass(Enum):
 class LanternClass(Enum):
     BATTLE = 0  # 打怪  --> 无法判断因为怪的图片不一样,用排除法
     BATTLE = 0  # 打怪  --> 无法判断因为怪的图片不一样,用排除法
@@ -258,7 +258,9 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets):
             elif answer_3 == '其余选项皆对':
             elif answer_3 == '其余选项皆对':
                 index = 3
                 index = 3
             if not index:
             if not index:
-                index = answer_one(question=question, options=[answer_1, answer_2, answer_3])
+                index = Answer().answer_one(question=question, options=[answer_1, answer_2, answer_3])
+            if index is None:
+                index = 1
             logger.info(f'Question: {question}, Answer: {index}')
             logger.info(f'Question: {question}, Answer: {index}')
             return click_match[index]
             return click_match[index]
 
 

+ 42 - 0
tasks/Quiz/assets.py

@@ -0,0 +1,42 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by ./dev_tools/assets_extract.py.
+# Don't modify it manually.
+class QuizAssets: 
+
+
+	# Image Rule Assets
+	# description 
+	I_ENTRY = RuleImage(roi_front=(143,363,40,128), roi_back=(119,246,100,326), threshold=0.8, method="Template matching", file="./tasks/Quiz/quiz/quiz_entry.png")
+	# 开始 
+	I_START = RuleImage(roi_front=(1149,608,66,41), roi_back=(1136,574,100,100), threshold=0.8, method="Template matching", file="./tasks/Quiz/quiz/quiz_start.png")
+	# 标志 
+	I_MESSAGE = RuleImage(roi_front=(75,488,58,41), roi_back=(50,460,100,100), threshold=0.8, method="Template matching", file="./tasks/Quiz/quiz/quiz_message.png")
+	# 失败然后离开 
+	I_FAIL_QUIT = RuleImage(roi_front=(416,529,183,45), roi_back=(354,502,275,100), threshold=0.8, method="Template matching", file="./tasks/Quiz/quiz/quiz_fail_quit.png")
+	# 结算分享 
+	I_SHARE = RuleImage(roi_front=(1171,625,53,44), roi_back=(1152,592,100,100), threshold=0.8, method="Template matching", file="./tasks/Quiz/quiz/quiz_share.png")
+
+
+	# Ocr Rule Assets
+	# Ocr-description 
+	O_QUESTION = RuleOcr(roi=(903,32,322,101), area=(903,32,322,101), mode="Single", method="Default", keyword="", name="question")
+	# Ocr-description 
+	O_ANSWER1 = RuleOcr(roi=(906,178,320,53), area=(906,178,320,53), mode="Single", method="Default", keyword="", name="answer1")
+	# Ocr-description 
+	O_ANSWER2 = RuleOcr(roi=(905,289,319,51), area=(905,289,319,51), mode="Single", method="Default", keyword="", name="answer2")
+	# Ocr-description 
+	O_ANSWER3 = RuleOcr(roi=(906,399,320,55), area=(906,399,320,55), mode="Single", method="Default", keyword="", name="answer3")
+	# Ocr-description 
+	O_ANSWER4 = RuleOcr(roi=(909,511,316,54), area=(909,511,316,54), mode="Single", method="Default", keyword="", name="answer4")
+	# 倒计时 
+	O_COUNTDOWN = RuleOcr(roi=(1045,6,27,30), area=(1045,6,27,30), mode="Digit", method="Default", keyword="4", name="countdown")
+	# 倒计时 
+	O_COUNTDOWN3 = RuleOcr(roi=(1045,6,27,30), area=(1045,6,27,30), mode="Digit", method="Default", keyword="3", name="countdown3")
+
+

+ 15 - 0
tasks/Quiz/config.py

@@ -0,0 +1,15 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from pydantic import BaseModel, Field
+
+from tasks.Component.config_scheduler import Scheduler
+from tasks.Component.config_base import ConfigBase
+
+class QuizConfig(ConfigBase):
+    #
+    quiz_cnt: int = Field(default=1, description='quiz_cnt_help')
+
+class Quiz(ConfigBase):
+    scheduler: Scheduler = Field(default_factory=Scheduler)
+    quiz_config: QuizConfig = Field(default_factory=QuizConfig)

+ 42 - 0
tasks/Quiz/debug.py

@@ -0,0 +1,42 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+import re
+
+from cached_property import cached_property
+from pathlib import Path
+
+from module.logger import logger
+
+
+def remove_symbols(text):
+    return re.sub(r'[^\w\s]', '', text)
+
+class Debugger:
+
+    @cached_property
+    def fn(self):
+        # 以添加方式打开一个文件
+        file: Path = Path(f'./log/quiz/supplement.txt')
+        if not file.parent.exists():
+            file.parent.mkdir(parents=True)
+        if not file.exists():
+            file.touch()
+        f = open(str(file), 'a')
+        return f
+
+    def append_one(self, question: str, options: list[str]):
+        question = remove_symbols(question)
+        options = [remove_symbols(option) for option in options]
+        self.fn.write(f'{question},{options[0]},{options[1]},{options[2]},{options[3]}\n')
+
+    def close_fn(self):
+        self.fn.close()
+
+
+if __name__ == '__main__':
+    a = Debugger()
+    a.append_one('1', ['1', '2', '3', '4'])
+    a.append_one('5', ['1', '2939/;.', '3', '4'])
+    a.append_one('1', ['1', '2', '3', '4'])
+    a.close_fn()

+ 47 - 0
tasks/Quiz/quiz/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "entry",
+    "imageName": "quiz_entry.png",
+    "roiFront": "143,363,40,128",
+    "roiBack": "119,246,100,326",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "start",
+    "imageName": "quiz_start.png",
+    "roiFront": "1149,608,66,41",
+    "roiBack": "1136,574,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "开始"
+  },
+  {
+    "itemName": "message",
+    "imageName": "quiz_message.png",
+    "roiFront": "75,488,58,41",
+    "roiBack": "50,460,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "标志"
+  },
+  {
+    "itemName": "fail_quit",
+    "imageName": "quiz_fail_quit.png",
+    "roiFront": "416,529,183,45",
+    "roiBack": "354,502,275,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "失败然后离开"
+  },
+  {
+    "itemName": "share",
+    "imageName": "quiz_share.png",
+    "roiFront": "1171,625,53,44",
+    "roiBack": "1152,592,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算分享"
+  }
+]

+ 65 - 0
tasks/Quiz/quiz/ocr.json

@@ -0,0 +1,65 @@
+[
+  {
+    "itemName": "question",
+    "roiFront": "903,32,322,101",
+    "roiBack": "903,32,322,101",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "answer1",
+    "roiFront": "906,178,320,53",
+    "roiBack": "906,178,320,53",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "answer2",
+    "roiFront": "905,289,319,51",
+    "roiBack": "905,289,319,51",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "answer3",
+    "roiFront": "906,399,320,55",
+    "roiBack": "906,399,320,55",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "answer4",
+    "roiFront": "909,511,316,54",
+    "roiBack": "909,511,316,54",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "countdown",
+    "roiFront": "1045,6,27,30",
+    "roiBack": "1045,6,27,30",
+    "mode": "Digit",
+    "method": "Default",
+    "keyword": "4",
+    "description": "倒计时"
+  },
+  {
+    "itemName": "countdown3",
+    "roiFront": "1045,6,27,30",
+    "roiBack": "1045,6,27,30",
+    "mode": "Digit",
+    "method": "Default",
+    "keyword": "3",
+    "description": "倒计时"
+  }
+]

BIN
tasks/Quiz/quiz/quiz_entry.png


BIN
tasks/Quiz/quiz/quiz_fail_quit.png


BIN
tasks/Quiz/quiz/quiz_message.png


BIN
tasks/Quiz/quiz/quiz_share.png


BIN
tasks/Quiz/quiz/quiz_start.png


+ 140 - 0
tasks/Quiz/script_task.py

@@ -0,0 +1,140 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from cached_property import cached_property
+
+from tasks.GameUi.game_ui import GameUi
+from tasks.GameUi.page import page_realm_raid, page_main
+from tasks.Quiz.assets import QuizAssets
+from tasks.ActivityShikigami.assets import ActivityShikigamiAssets
+from tasks.DemonEncounter.data.answer import Answer
+from tasks.Quiz.debug import Debugger, remove_symbols
+
+from module.logger import logger
+from module.exception import TaskEnd
+from module.atom.image_grid import ImageGrid
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+
+class ScriptTask(GameUi, QuizAssets, ActivityShikigamiAssets, Debugger):
+
+    last_select_1 = ''
+    last_select_2 = ''
+    last_select_3 = ''
+    last_select_4 = ''
+
+    @cached_property
+    def anwser(self) -> Answer:
+        # Misspelling
+        return Answer()
+
+    @cached_property
+    def click_options(self) -> list:
+        return [self.O_ANSWER1, self.O_ANSWER2, self.O_ANSWER3, self.O_ANSWER4]
+
+    def run(self):
+        self.ui_get_current_page()
+        self.ui_goto(page_main)
+        _config = self.config.model.quiz.quiz_config
+        self.enter()
+
+        quiz_cnt = 0
+        while 1:
+            if quiz_cnt >= _config.quiz_cnt:
+                break
+            self.once()
+            quiz_cnt += 1
+
+
+        self.ui_click(self.I_UI_BACK_YELLOW, self.I_CHECK_MAIN, interval=2)
+        self.set_next_run(task='Quiz', success=True, finish=True)
+        raise TaskEnd('Quiz')
+
+    def enter(self):
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_START):
+                break
+            if self.appear_then_click(self.I_SHI, interval=1):
+                continue
+            if self.appear_then_click(self.I_ENTRY, interval=1):
+                continue
+        logger.info('Quiz start')
+
+    def once(self) -> bool:
+        logger.hr('Quiz', 3)
+        self.ui_click(self.I_START, self.I_MESSAGE)
+        quests_cnt = 0
+        selected_flag = False
+        self.last_select_1, self.last_select_2, self.last_select_3, self.last_select_4 = '', '', '', ''
+
+        while 1:
+            self.screenshot()
+
+            if self.appear(self.I_FAIL_QUIT):
+                # 失败
+                logger.info('Quiz Fail and exit')
+                self.ui_click(self.I_FAIL_QUIT, self.I_START)
+                break
+            if self.appear(self.I_SHARE):
+                # 结算
+                logger.info('Quiz Victory and exit')
+                self.ui_click(self.I_UI_BACK_RED, self.I_START)
+                break
+            self._deal_quiz()
+        self.close_fn()
+
+    def detect_new(self, select_1, select_2, select_3, select_4) -> bool:
+        if self.last_select_1 != select_1 or \
+                self.last_select_2 != select_2 or \
+                self.last_select_3 != select_3 or \
+                self.last_select_4 != select_4:
+            return True
+        return False
+
+    def _deal_quiz(self):
+        answer_1 = self.O_ANSWER1.detect_text(self.device.image)
+        answer_2 = self.O_ANSWER2.detect_text(self.device.image)
+        answer_3 = self.O_ANSWER3.detect_text(self.device.image)
+        answer_4 = self.O_ANSWER4.detect_text(self.device.image)
+        if answer_1 == '' and answer_2 == '' and answer_3 == '' and answer_4 == '':
+            return False
+        if not self.detect_new(answer_1, answer_2, answer_3, answer_4) and\
+                not self.ocr_appear(self.O_COUNTDOWN) and\
+                not self.ocr_appear(self.O_COUNTDOWN3):
+            # 第一次换题目的时候 和 最后两秒钟的时候 进行选择
+            return False
+
+        self.last_select_1, self.last_select_2, self.last_select_3, self.last_select_4 = \
+            answer_1, answer_2, answer_3, answer_4
+        questions = self.O_QUESTION.detect_and_ocr(self.device.image)
+        question = ''.join([q.ocr_text for q in questions])
+        question = question.replace('?', '').replace('?', '').replace(' ', '').replace(',', ',')
+        question = remove_symbols(question)
+
+        index = self.anwser.answer_one(question=question,  options=[answer_1, answer_2, answer_3, answer_4])
+        if index is None:
+            logger.error('Now question has no answer, please check')
+            self.append_one(question=question, options=[answer_1, answer_2, answer_3, answer_4])
+            index = 1
+        logger.info(f'Question: {question}, Answer: {index}')
+        self.click(self.click_options[index-1])
+        return True
+
+
+
+
+
+
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+
+    c = Config('oas1')
+    d = Device(c)
+    t = ScriptTask(c, d)
+    t.screenshot()
+
+    t.run()

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff