ver Jan18th
completed all the incomplete tasks stored under libreoffice_calc before added metric check_data_validations
This commit is contained in:
@@ -10,8 +10,10 @@ import openpyxl
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from openpyxl import Workbook
|
from openpyxl import Workbook
|
||||||
from openpyxl.worksheet.worksheet import Worksheet
|
from openpyxl.worksheet.worksheet import Worksheet
|
||||||
|
#from openpyxl.worksheet.cell_range import MultiCellRange
|
||||||
|
from openpyxl.worksheet.datavalidation import DataValidation
|
||||||
|
|
||||||
from .utils import load_charts, load_sparklines
|
from .utils import load_charts, load_sparklines, _match_value_to_rule
|
||||||
|
|
||||||
logger = logging.getLogger("desktopenv.metric.table")
|
logger = logging.getLogger("desktopenv.metric.table")
|
||||||
|
|
||||||
@@ -27,7 +29,7 @@ def compare_table(actual: str, expected: str, **options) -> float:
|
|||||||
* sparkline
|
* sparkline
|
||||||
* chart
|
* chart
|
||||||
* number_format
|
* number_format
|
||||||
"chart_props": list of str, giving the converned chart properties
|
"chart_props": list of str, giving the concerned chart properties
|
||||||
"as_shown": bool, TODO
|
"as_shown": bool, TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,6 +166,57 @@ def check_xlsx_zoom(result: str, rules: Dict[str, Union[str, Number]]) -> float:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def check_data_validations(result: str, rules: List[Dict[str, Dict[str, Any]]]) -> float:
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
result (str): path to the concerned xlsx file
|
||||||
|
rules (List[Dict[str, Dict[str, Any]]]): list of dict like
|
||||||
|
{
|
||||||
|
<str as attribute>: {
|
||||||
|
"method": str
|
||||||
|
"ref": something
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Available attributes:
|
||||||
|
* ranges
|
||||||
|
* type
|
||||||
|
* formula1
|
||||||
|
* formula2
|
||||||
|
* operator
|
||||||
|
* allowBlank
|
||||||
|
* showDropDown
|
||||||
|
* showInputMessage
|
||||||
|
* showErrorMessage
|
||||||
|
* error
|
||||||
|
* errorTitle
|
||||||
|
* errorStyle
|
||||||
|
* prompt
|
||||||
|
* promptTitle
|
||||||
|
* imeMode
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
float
|
||||||
|
"""
|
||||||
|
|
||||||
|
workbook: Workbook = openpyxl.load_workbook(result)
|
||||||
|
worksheet: Worksheet = workbook.active
|
||||||
|
data_validators: List[DataValidation] = worksheet.data_validations.dataValidation
|
||||||
|
|
||||||
|
total_metric = True
|
||||||
|
for dat_vldt in data_validators:
|
||||||
|
metric = False
|
||||||
|
for r in rules:
|
||||||
|
metric = metric or all( _match_value_to_rule( getattr(dat_vldt, attrbt)
|
||||||
|
, mr
|
||||||
|
)\
|
||||||
|
for attrbt, mr in r.items()
|
||||||
|
)
|
||||||
|
if metric:
|
||||||
|
break
|
||||||
|
total_metric = total_metric and metric
|
||||||
|
if not total_metric:
|
||||||
|
break
|
||||||
|
return float(total_metric)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# path1 = ""
|
# path1 = ""
|
||||||
@@ -247,8 +300,31 @@ if __name__ == '__main__':
|
|||||||
# print(check_zoom(path1, {"relation": "lt", "ref_value": 100}))
|
# print(check_zoom(path1, {"relation": "lt", "ref_value": 100}))
|
||||||
# print(check_zoom(path2, {"relation": "lt", "ref_value": 100}))
|
# print(check_zoom(path2, {"relation": "lt", "ref_value": 100}))
|
||||||
|
|
||||||
path1 = "../../任务数据/LibreOffice Calc/Customers_New_7digit_Id.xlsx"
|
#path1 = "../../任务数据/LibreOffice Calc/Customers_New_7digit_Id.xlsx"
|
||||||
path2 = "../../任务数据/LibreOffice Calc/Customers_New_7digit_Id_gold.xlsx"
|
#path2 = "../../任务数据/LibreOffice Calc/Customers_New_7digit_Id_gold.xlsx"
|
||||||
#data_frame: pd.DataFrame = pd.read_excel(path1)
|
#data_frame: pd.DataFrame = pd.read_excel(path1)
|
||||||
#print(data_frame)
|
#print(data_frame)
|
||||||
print(compare_table(path1, path2, as_shown=True))
|
#print(compare_table(path1, path2, as_shown=True))
|
||||||
|
|
||||||
|
#from openpyxl.worksheet.cell_range import MultiCellRange
|
||||||
|
|
||||||
|
path = "../../任务数据/LibreOffice Calc/Order_Id_Mark_Pass_Fail_gold.xlsx"
|
||||||
|
#worksheet: Worksheet = openpyxl.load_workbook(filename=path).active
|
||||||
|
##print(worksheet.data_validations)
|
||||||
|
#print(type(worksheet.data_validations.dataValidation))
|
||||||
|
#for dat_vldt in worksheet.data_validations.dataValidation:
|
||||||
|
#print(dat_vldt.sqref)
|
||||||
|
#print(all(r in MultiCellRange("D2:D30 B1:B60") for r in dat_vldt.sqref))
|
||||||
|
print( check_data_validations( path, [ { "ranges": { "method": "spreadsheet_range"
|
||||||
|
, "ref": ["D2:D29", "D2:D1048576"]
|
||||||
|
}
|
||||||
|
, "type": { "method": "eq"
|
||||||
|
, "ref": "list"
|
||||||
|
}
|
||||||
|
, "formula1": { "method": "str_set_eq"
|
||||||
|
, "ref": ["Pass", "Fail", "Held"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from urllib.parse import urlparse, urlunparse
|
|||||||
import re
|
import re
|
||||||
import functools
|
import functools
|
||||||
import operator
|
import operator
|
||||||
|
import builtins
|
||||||
|
|
||||||
import lxml.cssselect
|
import lxml.cssselect
|
||||||
import lxml.etree
|
import lxml.etree
|
||||||
@@ -15,6 +16,7 @@ from lxml.etree import _Element
|
|||||||
from openpyxl import Workbook
|
from openpyxl import Workbook
|
||||||
from openpyxl.chart._chart import ChartBase
|
from openpyxl.chart._chart import ChartBase
|
||||||
from openpyxl.worksheet.worksheet import Worksheet
|
from openpyxl.worksheet.worksheet import Worksheet
|
||||||
|
from openpyxl.worksheet.cell_range import MultiCellRange
|
||||||
|
|
||||||
V = TypeVar("Value")
|
V = TypeVar("Value")
|
||||||
|
|
||||||
@@ -138,6 +140,8 @@ def load_charts(xlsx_file: Workbook, **options) -> Dict[str, Any]:
|
|||||||
def _match_record(pattern: Dict[str, Any], item: Dict[str, Any]) -> bool:
|
def _match_record(pattern: Dict[str, Any], item: Dict[str, Any]) -> bool:
|
||||||
return all(k in item and item[k] == val for k, val in pattern.items())
|
return all(k in item and item[k] == val for k, val in pattern.items())
|
||||||
|
|
||||||
|
def _multicellrange_containsby(subset_candidate: MultiCellRange, superset_candidate: MultiCellRange) -> bool:
|
||||||
|
return all(r in superset_candidate for r in subset_candidate)
|
||||||
def _match_value_to_rule(value: V, rule: Dict[str, Union[str, V]]) -> bool:
|
def _match_value_to_rule(value: V, rule: Dict[str, Union[str, V]]) -> bool:
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
@@ -165,6 +169,23 @@ def _match_value_to_rule(value: V, rule: Dict[str, Union[str, V]]) -> bool:
|
|||||||
, "ge", "gt"
|
, "ge", "gt"
|
||||||
}:
|
}:
|
||||||
return getattr(operator, rule["method"])(value, rule["ref"])
|
return getattr(operator, rule["method"])(value, rule["ref"])
|
||||||
|
if rule["method"] == "spreadsheet_range":
|
||||||
|
subset_limit = MultiCellRange(rule["ref"][0])
|
||||||
|
superset_limit = MultiCellRange(rule["ref"][1])
|
||||||
|
return _multicellrange_containsby(subset_limit, value)\
|
||||||
|
and _multicellrange_containsby(value, superset_limit)
|
||||||
|
if rule["method"].startswith("range."): # e.g., range.te [0, 2] -> 0 < x <= 2
|
||||||
|
left_et = rule["method"][6]
|
||||||
|
right_et = rule["method"][7]
|
||||||
|
return getattr(operator, "l" + left_et)(rule["ref"][0], value)\
|
||||||
|
and getattr(operator, "l" + right_et)(value, rule["ref"][1])
|
||||||
|
if rule["method"] in {"str_list_eq", "str_set_eq"}:
|
||||||
|
container_type_str: str = rule["method"][4:-3]
|
||||||
|
container_type = getattr(builtins, container_type_str)
|
||||||
|
|
||||||
|
value: container_type = container_type(value.strip("\"'").split(","))
|
||||||
|
ref: container_type = container_type(rule["ref"])
|
||||||
|
return value==ref
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def are_lists_equal(list1, list2, comparison_func):
|
def are_lists_equal(list1, list2, comparison_func):
|
||||||
|
|||||||
@@ -3,20 +3,65 @@
|
|||||||
"snapshot": "libreoffice_calc",
|
"snapshot": "libreoffice_calc",
|
||||||
"instruction": "Reorder the columns to be \"Data\", \"First Name\", \"Last Name\", \"Order ID\", \"Sales\"",
|
"instruction": "Reorder the columns to be \"Data\", \"First Name\", \"Last Name\", \"Order ID\", \"Sales\"",
|
||||||
"source": "https://www.youtube.com/shorts/bvUhr1AHs44",
|
"source": "https://www.youtube.com/shorts/bvUhr1AHs44",
|
||||||
"config": {
|
"config": [
|
||||||
"download": [
|
{
|
||||||
[
|
"type": "download",
|
||||||
"",
|
"parameters": {
|
||||||
"C:\\Users\\tianbaox\\Desktop\\Name_Order_Id_move_column.xlsx"
|
"files": [
|
||||||
]
|
{
|
||||||
],
|
"url": "https://drive.usercontent.google.com/download?id=1jS159dHRdeZh54A8WgqJn_somQpKP1K_&export=download&authuser=0&confirm=t&uuid=06aa5391-5f3e-499b-9073-9ce24109f91f&at=APZUnTWFCuiN8b5ilNmxx3aPYGUF:1705551767314",
|
||||||
"open": [
|
"path": "/home/user/Name_Order_Id_move_column.xlsx"
|
||||||
"C:\\Users\\tianbaox\\Desktop\\Name_Order_Id_move_column.xlsx"
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "open",
|
||||||
|
"parameters": {
|
||||||
|
"path": "/home/user/Name_Order_Id_move_column.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"trajectory": "trajectories/7a4e4bc8-922c-4c84-865c-25ba34136be1",
|
"trajectory": "trajectories/7a4e4bc8-922c-4c84-865c-25ba34136be1",
|
||||||
"related_apps": [
|
"related_apps": [
|
||||||
"libreoffice calc"
|
"libreoffice calc"
|
||||||
],
|
],
|
||||||
"evaluator": "evaluation_dir"
|
"evaluator": {
|
||||||
|
"postconfig": [
|
||||||
|
{
|
||||||
|
"type": "activate_window",
|
||||||
|
"parameters": {
|
||||||
|
"window_name": "Name_Order_Id_move_column.xlsx - LibreOffice Calc",
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "sleep",
|
||||||
|
"parameters": {
|
||||||
|
"seconds": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "execute",
|
||||||
|
"parameters": {
|
||||||
|
"command": [
|
||||||
|
"python",
|
||||||
|
"-c",
|
||||||
|
"import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"func": "compare_table",
|
||||||
|
"expected": {
|
||||||
|
"type": "cloud_file",
|
||||||
|
"path": "https://drive.usercontent.google.com/download?id=1jAK4--qLRdUOA57MBsmERpR205GGIMij&export=download&authuser=0&confirm=t&uuid=4ca454c9-d9d5-4e5f-95e1-cb0e849932e5&at=APZUnTVgkUbmLJLC4O7ACKmzfFbq:1705551965635",
|
||||||
|
"dest": "Name_Order_Id_move_column_gold.xlsx"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"type": "vm_file",
|
||||||
|
"path": "/home/user/Name_Order_Id_move_column.xlsx",
|
||||||
|
"dest": "Name_Order_Id_move_column.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,67 @@
|
|||||||
{
|
{
|
||||||
"id": "7efeb4b1-3d19-4762-b163-63328d66303b",
|
"id": "7efeb4b1-3d19-4762-b163-63328d66303b",
|
||||||
"snapshot": "libreoffice_calc",
|
"snapshot": "libreoffice_calc",
|
||||||
"instruction": "Fill in the Serieal Numbers in \"Serial #\" column",
|
"instruction": "Fill the Sequence Numbers as \"No. #\" in the \"Seq No.\" column",
|
||||||
"source": "https://www.youtube.com/shorts/4jzXfZNhfmk",
|
"source": "https://www.youtube.com/shorts/4jzXfZNhfmk",
|
||||||
"config": {
|
"config": [
|
||||||
"download": [
|
{
|
||||||
[
|
"type": "download",
|
||||||
"",
|
"parameters": {
|
||||||
"C:\\Users\\tianbaox\\Desktop\\Order_Sales_Serial#.xlsx"
|
"files": [
|
||||||
]
|
{
|
||||||
],
|
"url": "https://drive.usercontent.google.com/download?id=1muvWVg44C6EtBpBQkZ6_ylg3M8r3jjOC&export=download&authuser=0&confirm=t&uuid=41354a7c-d199-4044-960e-0d146fe6f12a&at=APZUnTW3nj5RV3SBJt5tdeVxM4mM:1705553238027",
|
||||||
"open": [
|
"path": "/home/user/Order_Sales_Serial#.xlsx"
|
||||||
"C:\\Users\\tianbaox\\Desktop\\Order_Sales_Serial#.xlsx"
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "open",
|
||||||
|
"parameters": {
|
||||||
|
"path": "/home/user/Order_Sales_Serial#.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"trajectory": "trajectories/",
|
"trajectory": "trajectories/",
|
||||||
"related_apps": [
|
"related_apps": [
|
||||||
"libreoffice calc"
|
"libreoffice calc"
|
||||||
],
|
],
|
||||||
"evaluator": "evaluation_dir"
|
"evaluator": {
|
||||||
|
"postconfig": [
|
||||||
|
{
|
||||||
|
"type": "activate_window",
|
||||||
|
"parameters": {
|
||||||
|
"window_name": "Order_Sales_Serial#.xlsx - LibreOffice Calc",
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "sleep",
|
||||||
|
"parameters": {
|
||||||
|
"seconds": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "execute",
|
||||||
|
"parameters": {
|
||||||
|
"command": [
|
||||||
|
"python",
|
||||||
|
"-c",
|
||||||
|
"import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"func": "compare_table",
|
||||||
|
"expected": {
|
||||||
|
"type": "cloud_file",
|
||||||
|
"path": "https://drive.usercontent.google.com/download?id=1K37qrxab2cib1SkKPthYkb83fzaj9ETa&export=download&authuser=0&confirm=t&uuid=66b763e6-2fb1-46fc-9753-7f8533366b82&at=APZUnTU1nCKKXBwCbyI8aKpdhE5W:1705560437314",
|
||||||
|
"dest": "Order_Sales_Serial#_gold.xlsx"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"type": "vm_file",
|
||||||
|
"path": "/home/user/Order_Sales_Serial#.xlsx",
|
||||||
|
"dest": "Order_Sales_Serial#.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,67 @@
|
|||||||
{
|
{
|
||||||
"id": "a9f325aa-8c05-4e4f-8341-9e4358565f4f",
|
"id": "a9f325aa-8c05-4e4f-8341-9e4358565f4f",
|
||||||
"snapshot": "libreoffice_calc",
|
"snapshot": "libreoffice_calc",
|
||||||
"instruction": "Clean the messy movie titles and put them in the cleaned column",
|
"instruction": "Remove the adundant whitespaces and canonicalize the letter cases by capitalizing the first letter of each words and leave other letters as lower case.",
|
||||||
"source": "https://www.youtube.com/shorts/A0gmEBRKXWs",
|
"source": "https://www.youtube.com/shorts/A0gmEBRKXWs",
|
||||||
"config": {
|
"config": [
|
||||||
"download": [
|
{
|
||||||
[
|
"type": "download",
|
||||||
"",
|
"parameters": {
|
||||||
"C:\\Users\\tianbaox\\Desktop\\"
|
"files": [
|
||||||
]
|
{
|
||||||
],
|
"url": "https://drive.usercontent.google.com/download?id=1PGJxDM5QglZFdLd7yLQnA2MASf2so14S&export=download&authuser=0&confirm=t&uuid=725f7d90-1e30-4579-b946-7c8932aac440&at=APZUnTUpha_2nl3sAOmM1AeCCir_:1705561280883",
|
||||||
"open": [
|
"path": "/home/user/Movie_title_garbage_clean.xlsx"
|
||||||
"C:\\Users\\tianbaox\\Desktop\\"
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "open",
|
||||||
|
"parameters": {
|
||||||
|
"path": "/home/user/Movie_title_garbage_clean.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"trajectory": "trajectories/a9f325aa-8c05-4e4f-8341-9e4358565f4f",
|
"trajectory": "trajectories/a9f325aa-8c05-4e4f-8341-9e4358565f4f",
|
||||||
"related_apps": [
|
"related_apps": [
|
||||||
"libreoffice calc"
|
"libreoffice calc"
|
||||||
],
|
],
|
||||||
"evaluator": "evaluation_dir"
|
"evaluator": {
|
||||||
|
"postconfig": [
|
||||||
|
{
|
||||||
|
"type": "activate_window",
|
||||||
|
"parameters": {
|
||||||
|
"window_name": "Movie_title_garbage_clean.xlsx - LibreOffice Calc",
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "sleep",
|
||||||
|
"parameters": {
|
||||||
|
"seconds": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "execute",
|
||||||
|
"parameters": {
|
||||||
|
"command": [
|
||||||
|
"python",
|
||||||
|
"-c",
|
||||||
|
"import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"func": "compare_table",
|
||||||
|
"expected": {
|
||||||
|
"type": "cloud_file",
|
||||||
|
"path": "https://drive.usercontent.google.com/download?id=1hrmRQig53UW069MEN_V23xJXFrIooylm&export=download&authuser=0&confirm=t&uuid=82a01881-c72c-4463-b258-c8c66f8d72af&at=APZUnTVZVuQj91twmMdH1plMcABA:1705561377705",
|
||||||
|
"dest": "Movie_title_garbage_clean_gold.xlsx"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"type": "vm_file",
|
||||||
|
"path": "/home/user/Movie_title_garbage_clean.xlsx",
|
||||||
|
"dest": "Movie_title_garbage_clean.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,67 @@
|
|||||||
{
|
{
|
||||||
"id": "d681960f-7bc3-4286-9913-a8812ba3261a",
|
"id": "d681960f-7bc3-4286-9913-a8812ba3261a",
|
||||||
"snapshot": "libreoffice_calc",
|
"snapshot": "libreoffice_calc",
|
||||||
"instruction": "According to the green table shown above, calculate and give each student a grade",
|
"instruction": "According to the scale table shown above, calculate and give each student a grade in the table below",
|
||||||
"source": "https://www.youtube.com/shorts/d7U1S_IsTVM",
|
"source": "https://www.youtube.com/shorts/d7U1S_IsTVM",
|
||||||
"config": {
|
"config": [
|
||||||
"download": [
|
{
|
||||||
[
|
"type": "download",
|
||||||
"https://drive.usercontent.google.com/download?id=1wodZjx1KjThUsrtF6ZJaCTy1fQX4E9vA&export=download&authuser=0&confirm=t&uuid=d07ca312-1abc-40f2-81cd-d06e27119854&at=APZUnTWwjnxsHQYapSvpLR8NmlfV:1701785087048",
|
"parameters": {
|
||||||
"C:\\Users\\tianbaox\\Desktop\\Student_Grades_and_Remarks.xlsx"
|
"files": [
|
||||||
]
|
{
|
||||||
],
|
"url": "https://drive.usercontent.google.com/download?id=1wodZjx1KjThUsrtF6ZJaCTy1fQX4E9vA&export=download&authuser=0&confirm=t&uuid=d07ca312-1abc-40f2-81cd-d06e27119854&at=APZUnTWwjnxsHQYapSvpLR8NmlfV:1701785087048",
|
||||||
"open": [
|
"path": "/home/user/Student_Grades_and_Remarks.xlsx"
|
||||||
"C:\\Users\\tianbaox\\Desktop\\Student_Grades_and_Remarks.xlsx"
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "open",
|
||||||
|
"parameters": {
|
||||||
|
"path": "/home/user/Student_Grades_and_Remarks.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"trajectory": "trajectories/d681960f-7bc3-4286-9913-a8812ba3261a",
|
"trajectory": "trajectories/d681960f-7bc3-4286-9913-a8812ba3261a",
|
||||||
"related_apps": [
|
"related_apps": [
|
||||||
"libreoffice calc"
|
"libreoffice calc"
|
||||||
],
|
],
|
||||||
"evaluator": {
|
"evaluator": {
|
||||||
"func": "compare_table(expected, actual)",
|
"postconfig": [
|
||||||
"paths": {
|
{
|
||||||
"expected": {
|
"type": "activate_window",
|
||||||
"type": "cloud_file",
|
"parameters": {
|
||||||
"path": "https://drive.usercontent.google.com/download?id=1kfEHJH1n0yCsQp443IIFvdD9uWv0DWMr&export=download&authuser=0&confirm=t&uuid=d9907f65-8d39-4ecc-8747-b4ed7e6011f5&at=APZUnTXpPAnlh5sD6q-R8oQtqL6g:1702362952170"
|
"window_name": "Student_Grades_and_Remarks.xlsx - LibreOffice Calc",
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"actual": {
|
{
|
||||||
"type": "vm_file",
|
"type": "sleep",
|
||||||
"path": "C:\\Users\\tianbaox\\Desktop\\Student_Grades_and_Remarks.xlsx"
|
"parameters": {
|
||||||
|
"seconds": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "execute",
|
||||||
|
"parameters": {
|
||||||
|
"command": [
|
||||||
|
"python",
|
||||||
|
"-c",
|
||||||
|
"import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"func": "compare_table",
|
||||||
|
"expected": {
|
||||||
|
"type": "cloud_file",
|
||||||
|
"path": "https://drive.usercontent.google.com/download?id=1kfEHJH1n0yCsQp443IIFvdD9uWv0DWMr&export=download&authuser=0&confirm=t&uuid=d9907f65-8d39-4ecc-8747-b4ed7e6011f5&at=APZUnTXpPAnlh5sD6q-R8oQtqL6g:1702362952170",
|
||||||
|
"dest": "Student_Grades_and_Remarks_gold.xlsx"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"type": "vm_file",
|
||||||
|
"path": "/home/user/Student_Grades_and_Remarks.xlsx",
|
||||||
|
"dest": "Student_Grades_and_Remarks.xlsx"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,67 @@
|
|||||||
{
|
{
|
||||||
"id": "eb03d19a-b88d-4de4-8a64-ca0ac66f426b",
|
"id": "eb03d19a-b88d-4de4-8a64-ca0ac66f426b",
|
||||||
"snapshot": "libreoffice_calc",
|
"snapshot": "libreoffice_calc",
|
||||||
"instruction": "Traverse the table and paste it below",
|
"instruction": "Transpose the table and paste it starting from B8",
|
||||||
"source": "https://www.youtube.com/shorts/t9JLUaT55UQ",
|
"source": "https://www.youtube.com/shorts/t9JLUaT55UQ",
|
||||||
"config": {
|
"config": [
|
||||||
"download": [
|
{
|
||||||
[
|
"type": "download",
|
||||||
"",
|
"parameters": {
|
||||||
"C:\\Users\\tianbaox\\Desktop\\"
|
"files": [
|
||||||
]
|
{
|
||||||
],
|
"url": "https://drive.usercontent.google.com/download?id=1Zl6ZUkbiV9sISjJRfracd8-xKrW2G3yv&export=download&authuser=0&confirm=t&uuid=6799cca6-62d2-4cfa-b28a-b8da486b5d01&at=APZUnTVy7-CQMjvuFyu7ZMxztfT6:1705563660974",
|
||||||
"open": [
|
"path": "/home/user/Students_Class_Subject_Marks.xlsx"
|
||||||
"C:\\Users\\tianbaox\\Desktop\\"
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "open",
|
||||||
|
"parameters": {
|
||||||
|
"path": "/home/user/Students_Class_Subject_Marks.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"trajectory": "trajectories/eb03d19a-b88d-4de4-8a64-ca0ac66f426b",
|
"trajectory": "trajectories/eb03d19a-b88d-4de4-8a64-ca0ac66f426b",
|
||||||
"related_apps": [
|
"related_apps": [
|
||||||
"libreoffice calc"
|
"libreoffice calc"
|
||||||
],
|
],
|
||||||
"evaluator": "evaluation_dir"
|
"evaluator": {
|
||||||
|
"postconfig": [
|
||||||
|
{
|
||||||
|
"type": "activate_window",
|
||||||
|
"parameters": {
|
||||||
|
"window_name": "Students_Class_Subject_Marks.xlsx - LibreOffice Calc",
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "sleep",
|
||||||
|
"parameters": {
|
||||||
|
"seconds": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "execute",
|
||||||
|
"parameters": {
|
||||||
|
"command": [
|
||||||
|
"python",
|
||||||
|
"-c",
|
||||||
|
"import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"func": "compare_table",
|
||||||
|
"expected": {
|
||||||
|
"type": "cloud_file",
|
||||||
|
"path": "https://drive.usercontent.google.com/download?id=1GwqF52n6cvmQ-ivhmfNCep9mZboQ706-&export=download&authuser=0&confirm=t&uuid=4c750a20-73b8-4072-a4bf-3a4aa77b314a&at=APZUnTXYm-3NVdfneACqfDLYCWko:1705563733494",
|
||||||
|
"dest": "Students_Class_Subject_Marks_gold.xlsx"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"type": "vm_file",
|
||||||
|
"path": "/home/user/Students_Class_Subject_Marks.xlsx",
|
||||||
|
"dest": "Students_Class_Subject_Marks.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,20 +3,79 @@
|
|||||||
"snapshot": "libreoffice_calc",
|
"snapshot": "libreoffice_calc",
|
||||||
"instruction": "Enable each cell in the column\"Pass/Fail/Held\" is a drop down list",
|
"instruction": "Enable each cell in the column\"Pass/Fail/Held\" is a drop down list",
|
||||||
"source": "https://www.youtube.com/shorts/tXOovKn0H68",
|
"source": "https://www.youtube.com/shorts/tXOovKn0H68",
|
||||||
"config": {
|
"config": [
|
||||||
"download": [
|
{
|
||||||
[
|
"type": "download",
|
||||||
"",
|
"parameters": {
|
||||||
"C:\\Users\\tianbaox\\Desktop\\"
|
"files": [
|
||||||
]
|
{
|
||||||
],
|
"url": "https://drive.usercontent.google.com/download?id=1vKtnFG-sL7Ba0UCcUh4dWJDfZeAHAP6l&export=download&authuser=0&confirm=t&uuid=70a267fa-dc71-4893-8fe3-a7254e50c567&at=APZUnTVfnhipGIdrD39159Eqv9lf:1705567650653",
|
||||||
"open": [
|
"path": "/home/user/Order_Id_Mark_Pass_Fail.xlsx"
|
||||||
"C:\\Users\\tianbaox\\Desktop\\"
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "open",
|
||||||
|
"parameters": {
|
||||||
|
"path": "/home/user/Order_Id_Mark_Pass_Fail.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"trajectory": "trajectories/ecb0df7a-4e8d-4a03-b162-053391d3afaf",
|
"trajectory": "trajectories/ecb0df7a-4e8d-4a03-b162-053391d3afaf",
|
||||||
"related_apps": [
|
"related_apps": [
|
||||||
"libreoffice calc"
|
"libreoffice calc"
|
||||||
],
|
],
|
||||||
"evaluator": "evaluation_dir"
|
"evaluator": {
|
||||||
|
"postconfig": [
|
||||||
|
{
|
||||||
|
"type": "activate_window",
|
||||||
|
"parameters": {
|
||||||
|
"window_name": "Order_Id_Mark_Pass_Fail.xlsx - LibreOffice Calc",
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "sleep",
|
||||||
|
"parameters": {
|
||||||
|
"seconds": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "execute",
|
||||||
|
"parameters": {
|
||||||
|
"command": [
|
||||||
|
"python",
|
||||||
|
"-c",
|
||||||
|
"import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"func": "check_data_validations",
|
||||||
|
"expected": {
|
||||||
|
"type": "rule",
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"ranges": {
|
||||||
|
"method": "spreadsheet_range",
|
||||||
|
"ref": ["D2:D29", "D2:D1048576"]
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"method": "eq",
|
||||||
|
"ref": "list"
|
||||||
|
},
|
||||||
|
"formula1": {
|
||||||
|
"method": "str_set_eq",
|
||||||
|
"ref": ["Pass", "Fail", "Held"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"type": "vm_file",
|
||||||
|
"path": "/home/user/Order_Id_Mark_Pass_Fail.xlsx",
|
||||||
|
"dest": "Order_Id_Mark_Pass_Fail.xlsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user