diff --git a/src/source/dialog/openwithdialog/openwithdialog.cpp b/src/source/dialog/openwithdialog/openwithdialog.cpp index dcdcb761a..1452add98 100644 --- a/src/source/dialog/openwithdialog/openwithdialog.cpp +++ b/src/source/dialog/openwithdialog/openwithdialog.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -28,6 +28,8 @@ OpenWithDialogListItem::OpenWithDialogListItem(const QIcon &icon, const QString } m_pCheckBtn = new DIconButton(this); + m_pCheckBtn->setObjectName("CheckButton"); + m_pCheckBtn->setAccessibleName("CheckButton"); m_pCheckBtn->setFixedSize(10, 10); m_pCheckBtn->setFlat(true); @@ -320,10 +322,18 @@ void OpenWithDialog::init() qDebug() << "Created recommended and other apps layouts"; m_pOpenFileChooseButton = new QCommandLinkButton(tr("Add other programs")); + m_pOpenFileChooseButton->setObjectName("OpenFileChooseButton"); + m_pOpenFileChooseButton->setAccessibleName("OpenFileChooseButton"); m_pSetToDefaultCheckBox = new QCheckBox(tr("Set as default")); + m_pSetToDefaultCheckBox->setObjectName("SetToDefaultCheckBox"); + m_pSetToDefaultCheckBox->setAccessibleName("SetToDefaultCheckBox"); m_pSetToDefaultCheckBox->setChecked(true); m_pCancelButton = new QPushButton(tr("Cancel", "button")); + m_pCancelButton->setObjectName("OpenWithDialog_CancelButton"); + m_pCancelButton->setAccessibleName("OpenWithDialog_CancelButton"); m_pChooseButton = new QPushButton(tr("Confirm", "button")); + m_pChooseButton->setObjectName("OpenWithDialog_ChooseButton"); + m_pChooseButton->setAccessibleName("OpenWithDialog_ChooseButton"); qDebug() << "Created all buttons and controls"; QVBoxLayout *content_layout = new QVBoxLayout; diff --git a/src/source/dialog/popupdialog.cpp b/src/source/dialog/popupdialog.cpp index b2c1badfe..c74dc2637 100644 --- a/src/source/dialog/popupdialog.cpp +++ b/src/source/dialog/popupdialog.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -604,6 +604,8 @@ int RenameDialog::showDialog(const QString &strReName, const QString &strAlias, qDebug() << "Showing RenameDialog for:" << strReName << "isDirectory:" << isDirectory << "isRepeat:" << isRepeat; if(m_lineEdit == NULL) {//创建DLineEdit,设定显示规则。 m_lineEdit = new DLineEdit(this); + m_lineEdit->setObjectName("PopupDialog_LineEdit"); + m_lineEdit->setAccessibleName("PopupDialog_LineEdit"); //使用 QValidator 在输入时直接拒绝非法字符,避免在 textChanged 中 setText 导致光标跳动 //第一位不允许空格和特殊字符,后续位不允许特殊字符(中间空格允许) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) diff --git a/src/source/page/compresspage.cpp b/src/source/page/compresspage.cpp index 45b5fd3a9..922c1106d 100644 --- a/src/source/page/compresspage.cpp +++ b/src/source/page/compresspage.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -75,6 +75,8 @@ void CompressPage::initUI() // 初始化相关变量 m_pCompressView = new CompressView(this); m_pNextBtn = new CustomPushButton(tr("Next"), this); + m_pNextBtn->setObjectName("NextButton"); + m_pNextBtn->setAccessibleName("NextButton"); m_pNextBtn->setMinimumWidth(340); // 按钮布局 diff --git a/src/source/page/compresssettingpage.cpp b/src/source/page/compresssettingpage.cpp index bb53f6544..67285557e 100644 --- a/src/source/page/compresssettingpage.cpp +++ b/src/source/page/compresssettingpage.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -230,21 +230,43 @@ void CompressSettingPage::initUI() DLabel *pAdvancedLbl = new DLabel(tr("Advanced Options"), this); pAdvancedLbl->setForegroundRole(DPalette::WindowText); m_pFileNameEdt = new DLineEdit(this); + m_pFileNameEdt->setObjectName("FileNameEdit"); + m_pFileNameEdt->setAccessibleName("FileNameEdit"); m_pSavePathEdt = new DFileChooserEdit(this); + m_pSavePathEdt->setObjectName("SavePathEdit"); + m_pSavePathEdt->setAccessibleName("SavePathEdit"); m_pCompressLevelLbl = new DLabel(tr("Compression method") + ":", this); m_pCompressLevelCmb = new CustomCombobox(this); + m_pCompressLevelCmb->setObjectName("CompressLevelComboBox"); + m_pCompressLevelCmb->setAccessibleName("CompressLevelComboBox"); m_pAdvancedBtn = new CustomSwitchButton(this); + m_pAdvancedBtn->setObjectName("AdvancedButton"); + m_pAdvancedBtn->setAccessibleName("AdvancedButton"); m_pEncryptedLbl = new DLabel(tr("Encrypt the archive") + ":", this); m_pPasswordEdt = new DPasswordEdit(this); + m_pPasswordEdt->setObjectName("PasswordEdit"); + m_pPasswordEdt->setAccessibleName("PasswordEdit"); m_pCpuLbl = new DLabel(tr("CPU threads") + ":", this); m_pCpuCmb = new CustomCombobox(this); + m_pCpuCmb->setObjectName("CpuComboBox"); + m_pCpuCmb->setAccessibleName("CpuComboBox"); m_pListEncryptionLbl = new DLabel(tr("Encrypt the file list too"), this); m_pListEncryptionBtn = new CustomSwitchButton(this); + m_pListEncryptionBtn->setObjectName("ListEncryptionButton"); + m_pListEncryptionBtn->setAccessibleName("ListEncryptionButton"); m_pSplitCkb = new CustomCheckBox(tr("Split to volumes") + ":", this); + m_pSplitCkb->setObjectName("SplitCheckBox"); + m_pSplitCkb->setAccessibleName("SplitCheckBox"); m_pSplitValueEdt = new DDoubleSpinBox(this); + m_pSplitValueEdt->setObjectName("SplitValueEdit"); + m_pSplitValueEdt->setAccessibleName("SplitValueEdit"); m_pCommentLbl = new DLabel(tr("Comment") + ":", this); m_pCommentEdt = new DTextEdit(this); + m_pCommentEdt->setObjectName("CommentEdit"); + m_pCommentEdt->setAccessibleName("CommentEdit"); m_pCompressBtn = new CustomPushButton(tr("Compress", "button"), this); + m_pCompressBtn->setObjectName("CompressSettingPage_CompressButton"); + m_pCompressBtn->setAccessibleName("CompressSettingPage_CompressButton"); m_pFileNameEdt->setMinimumWidth(260); // 配置文件名属性 QLineEdit *pNameEdt = m_pFileNameEdt->lineEdit(); @@ -381,6 +403,8 @@ void CompressSettingPage::initUI() // 初始化菜单 m_pTypeMenu = new QMenu(this); + m_pTypeMenu->setObjectName("TypeMenu"); + m_pTypeMenu->setAccessibleName("TypeMenu"); m_pTypeMenu->setMinimumWidth(162); setBackgroundRole(DPalette::Base); diff --git a/src/source/page/failurepage.cpp b/src/source/page/failurepage.cpp index 4342ffa0c..b6d72dde4 100644 --- a/src/source/page/failurepage.cpp +++ b/src/source/page/failurepage.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -93,11 +93,15 @@ void FailurePage::initUI() //重试按钮 m_pRetrybutton = new CustomPushButton(this); + m_pRetrybutton->setObjectName("RetryButton"); + m_pRetrybutton->setAccessibleName("RetryButton"); m_pRetrybutton->setMinimumWidth(340); m_pRetrybutton->setText(tr("Retry", "button")); //返回按钮 commandLinkBackButton = new CustomCommandLinkButton(tr("Back"), this); + commandLinkBackButton->setObjectName("CommandLinkBackButton"); + commandLinkBackButton->setAccessibleName("CommandLinkBackButton"); //界面布局 QVBoxLayout *mainlayout = new QVBoxLayout(this); diff --git a/src/source/page/homepage.cpp b/src/source/page/homepage.cpp index 2755779b1..756ab9f7f 100644 --- a/src/source/page/homepage.cpp +++ b/src/source/page/homepage.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -43,6 +43,8 @@ void HomePage::initUI() m_pTipLbl = new DLabel(tr("Drag file or folder here"), this); m_pSplitLbl = new DLabel(this); m_pChooseBtn = new CustomCommandLinkButton(tr("Select File"), this); + m_pChooseBtn->setObjectName("HomePage_ChooseButton"); + m_pChooseBtn->setAccessibleName("HomePage_ChooseButton"); m_pSettings = new QSettings(QDir(UiTools::getConfigPath()).filePath("config.conf"), QSettings::IniFormat, this); // 初始化控件布局 diff --git a/src/source/page/progresspage.cpp b/src/source/page/progresspage.cpp index 8087e239a..d2b67c6f6 100644 --- a/src/source/page/progresspage.cpp +++ b/src/source/page/progresspage.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -221,7 +221,11 @@ void ProgressPage::initUI() m_pSpeedLbl = new DLabel(this); m_pRemainingTimeLbl = new DLabel(this); m_pCancelBtn = new CustomPushButton(tr("Cancel", "button"), this); + m_pCancelBtn->setObjectName("ProgressPage_CancelButton"); + m_pCancelBtn->setAccessibleName("ProgressPage_CancelButton"); m_pPauseContinueButton = new CustomSuggestButton(tr("Pause", "button"), this); + m_pPauseContinueButton->setObjectName("PauseContinueButton"); + m_pPauseContinueButton->setAccessibleName("PauseContinueButton"); // 初始化压缩包名称样式 DFontSizeManager::instance()->bind(m_pArchiveNameLbl, DFontSizeManager::T5, QFont::DemiBold); diff --git a/src/source/page/successpage.cpp b/src/source/page/successpage.cpp index 28166f6d8..7ad6af3da 100644 --- a/src/source/page/successpage.cpp +++ b/src/source/page/successpage.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -76,11 +76,15 @@ void SuccessPage::initUI() //查看文件按钮 m_pShowFileBtn = new CustomPushButton(this); + m_pShowFileBtn->setObjectName("ShowFileButton"); + m_pShowFileBtn->setAccessibleName("ShowFileButton"); m_pShowFileBtn->setMinimumWidth(340); m_pShowFileBtn->setText(tr("View")); //返回按钮 m_pReturnBtn = new CustomCommandLinkButton(tr("Back"), this); + m_pReturnBtn->setObjectName("ReturnButton"); + m_pReturnBtn->setAccessibleName("ReturnButton"); //界面布局 QVBoxLayout *mainlayout = new QVBoxLayout(this); diff --git a/src/source/page/uncompresspage.cpp b/src/source/page/uncompresspage.cpp index c097acc0d..161a0207a 100644 --- a/src/source/page/uncompresspage.cpp +++ b/src/source/page/uncompresspage.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -114,7 +114,11 @@ void UnCompressPage::initUI() // 初始化相关变量 m_pUnCompressView = new UnCompressView(this); m_pUncompressPathBtn = new CustomCommandLinkButton(tr("Extract to:") + " ~/Desktop", this); + m_pUncompressPathBtn->setObjectName("UncompressPathButton"); + m_pUncompressPathBtn->setAccessibleName("UncompressPathButton"); m_pUnCompressBtn = new CustomPushButton(tr("Extract", "button"), this); + m_pUnCompressBtn->setObjectName("UnCompressButton"); + m_pUnCompressBtn->setAccessibleName("UnCompressButton"); m_pUncompressPathBtn->setToolTip(m_strUnCompressPath); diff --git a/src/source/tree/datatreeview.cpp b/src/source/tree/datatreeview.cpp index 1f9a3c886..58cf1878e 100644 --- a/src/source/tree/datatreeview.cpp +++ b/src/source/tree/datatreeview.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -195,6 +195,8 @@ void DataTreeView::initUI() // 设置表头 m_pHeaderView = new TreeHeaderView(Qt::Horizontal, this); + m_pHeaderView->setObjectName("DataTreeView_HeaderView"); + m_pHeaderView->setAccessibleName("DataTreeView_HeaderView"); m_pHeaderView->setStretchLastSection(true); setHeader(m_pHeaderView); diff --git a/tests/at/cases_mapped.yaml b/tests/at/cases_mapped.yaml new file mode 100644 index 000000000..3c6da507a --- /dev/null +++ b/tests/at/cases_mapped.yaml @@ -0,0 +1,505 @@ +version: '1.0' +cases: +- id: suite_归档管理器_006_s1 + name: 文件添加与选择-【归档管理器】根目录添加文件;【归档管理器】不同路径文件压缩;【归档管理器】授权提示01;【归档管理器】 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: assert + action: assert_element + selector: + name: 选择文件 + role: button +- id: suite_归档管理器_011_s1 + name: 压缩设置与执行-【归档管理器】压缩深路径文件;【归档管理器】压缩快捷键;【归档管理器】特殊符号命名压缩包;【归档管理器】 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 压 缩 + role: button + do: click + - step_type: assert + action: assert_element + selector: + name: 压 缩 + role: button +- id: suite_归档管理器_015_s1 + name: 解压操作-【归档管理器】解压列表打开;【归档管理器】解压列表打开2;【归档管理器】授权提示02;【归档管理器】成功界面点 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 添加其他程序 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 确 定 + role: button + do: click + - step_type: assert + action: assert_element + selector: + name: 解 压 + role: button +- id: suite_归档管理器_016_s1 + name: 解压操作-【归档管理器】提取文件取消;【归档管理器】右键解压缩;【归档管理器】右键解压到当前文件夹;【归档管理器】右键解 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: click + - step_type: assert + action: assert_element + selector: + name: 解 压 + role: button +- id: suite_归档管理器_020_s1 + name: 密码与加密-【归档管理器】[008]汉字密码加密包02;【归档管理器】[007]汉字密码加密包01;【归档管理器】密码框 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + ref: ListEncryptionButton + do: click + - step_type: action + action: keyboard_type + text: test123 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: assert + action: assert_element + ref: ListEncryptionButton +- id: suite_归档管理器_023_s1 + name: 分卷压缩-【归档管理器】分卷压缩;【归档管理器】解压分卷压缩包;【归档管理器】解压分卷压缩包2;【归档管理器】zip分卷 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: element_action + selector: + name: '分卷压缩:' + role: check box + do: click + - step_type: action + action: keyboard_type + text: '200' + - step_type: action + action: element_action + selector: + name: 压 缩 + role: button + do: click + - step_type: assert + action: assert_element + selector: + name: '分卷压缩:' + role: check box +- id: suite_归档管理器_025_s1 + name: 进度暂停与取消-【归档管理器】解压速率显示;【归档管理器】压缩速率显示;【归档管理器】压缩过程中取消压缩;【归档管理器】 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 压 缩 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 暂 停 + role: check box + do: click + - step_type: action + action: element_action + selector: + name: 取 消 + role: button + do: click + - step_type: assert + action: assert_element + selector: + name: 取 消 + role: button +- id: suite_归档管理器_027_s1 + name: 导航与返回-【归档管理器】帮助手册;【归档管理器】关于 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: keyboard_press + key: Down + - step_type: action + action: keyboard_press + key: Return + - step_type: action + action: element_action + selector: + name: 返回 + role: button + index: 0 + do: click + - step_type: action + action: element_action + selector: + name: 重 试 + role: button + do: click + - step_type: assert + action: assert_element + selector: + name: 返回 + role: button + index: 0 +- id: suite_归档管理器_031_s1 + name: CPU线程设置-【归档管理器】CPU线程数-八线程;【归档管理器】CPU线程数-单线程;【归档管理器】追加压缩时候的并行 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 单线程 + role: combo box + do: click + - step_type: action + action: keyboard_press + key: Down + - step_type: assert + action: assert_element + selector: + name: 单线程 + role: combo box +- id: suite_归档管理器_032_s1 + name: 重命名操作-【归档管理器】[010]压缩包重命名;【归档管理器】文件变动提示;【归档管理器】文件默认名称重命名;【归档管 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: right_click + - step_type: action + action: element_action + selector: + name: DLineEditChildLineEdit + role: text + index: 0 + do: focus + - step_type: action + action: keyboard_type + text: test + - step_type: assert + action: assert_element + selector: + name: DLineEditChildLineEdit + role: text + index: 0 +- id: suite_归档管理器_033_s1 + name: 设置选项-解压后删除压缩文件与推荐选项设置 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: keyboard_press + key: Tab + - step_type: action + action: element_action + selector: + name: 推荐选择 + role: button + do: click + - step_type: assert + action: assert_element + selector: + name: 推荐选择 + role: button +- id: suite_归档管理器_034_s1 + name: 结果显示与查看-解压成功后显示文件 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 查看文件 + role: button + do: click + - step_type: action + action: screenshot + - step_type: assert + action: assert_element + selector: + name: 查看文件 + role: button +- id: suite_归档管理器_035_s1 + name: 解压操作-设置解压路径 + module: 归档管理器 + steps: + - step_type: action + action: element_action + selector: + name: 选择文件 + role: button + do: click + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 解压到: ~/Desktop + role: button + do: click + - step_type: action + action: keyboard_type + text: /tmp/test + - step_type: action + action: keyboard_press + key: Return + - step_type: assert + action: assert_element + selector: + name: 解压到: ~/Desktop + role: button diff --git a/tests/at/coverage-report.yaml b/tests/at/coverage-report.yaml new file mode 100644 index 000000000..aa5c8131e --- /dev/null +++ b/tests/at/coverage-report.yaml @@ -0,0 +1,9 @@ +scan_total: 16 +transient_items: [] +unreachable: 0 +denominator: 16 +covered: 16 +uncovered: 0 +coverage: 100.0 +passed: true +uncovered_elements: [] diff --git a/tests/at/element-coverage-manifest.yaml b/tests/at/element-coverage-manifest.yaml new file mode 100644 index 000000000..8f856390e --- /dev/null +++ b/tests/at/element-coverage-manifest.yaml @@ -0,0 +1,211 @@ +version: '1.0' +source: at-case-authoring:element-map.yaml +scan_total: 16 +elements: + DLineEditChildLineEdit: + role: text + ui_name: 重命名 + desc: 'deepin-compressor UI元素: 重命名' + locator: name + 推荐选择: + role: button + ui_name: 推荐选项 + desc: 'deepin-compressor UI元素: 推荐选项' + locator: name + 添加其他程序: + role: button + ui_name: 打开 + desc: 'deepin-compressor UI元素: 打开' + locator: name + 确 定: + role: button + ui_name: 其他打开方式 + desc: 'deepin-compressor UI元素: 其他打开方式' + locator: name + 下一步: + role: button + ui_name: 下一步按钮 + desc: 'deepin-compressor UI元素: 下一步按钮' + locator: name + 重 试: + role: button + ui_name: 返回 + desc: 'deepin-compressor UI元素: 返回' + locator: name + 解压到: ~/Desktop: + role: button + ui_name: 提取文件到当前文件夹 + desc: 'deepin-compressor UI元素: 提取文件到当前文件夹' + locator: name + 取 消: + role: button + ui_name: 取消按钮 + desc: 'deepin-compressor UI元素: 取消按钮' + locator: name + 解 压: + role: button + ui_name: 解压 + desc: 'deepin-compressor UI元素: 解压' + locator: name + '分卷压缩:': + role: check box + ui_name: 分卷压缩 + desc: 'deepin-compressor UI元素: 分卷压缩' + locator: name + 压 缩: + role: button + ui_name: 压缩按钮 + desc: 'deepin-compressor UI元素: 压缩按钮' + locator: name + 查看文件: + role: button + ui_name: 显示文件按钮 + desc: 'deepin-compressor UI元素: 显示文件按钮' + locator: name + 选择文件: + role: button + ui_name: 选择文件 + desc: 'deepin-compressor UI元素: 选择文件' + locator: name + 返回: + role: button + ui_name: 返回按钮 + desc: 'deepin-compressor UI元素: 返回按钮' + locator: name + 暂 停: + role: check box + ui_name: 界面上暂停按钮 + desc: 'deepin-compressor UI元素: 界面上暂停按钮' + locator: name + 单线程: + role: combo box + ui_name: 双线程 + desc: 'deepin-compressor UI元素: 双线程' + locator: name +transient_items: [] +unresolved: +- name: 密码显示按钮 + role: check box + ui_name: 密码显示按钮 + desc: 'deepin-compressor UI元素: 密码显示按钮' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 确定按钮 + role: '' + ui_name: 确定按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 确认按钮 + role: '' + ui_name: 确认按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: dock上的图标 + role: '' + ui_name: dock上的图标 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 启动器点击图标 + role: '' + ui_name: 启动器点击图标 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 帮助 + role: '' + ui_name: 帮助 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 主菜单 + role: '' + ui_name: 主菜单 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 关于 + role: '' + ui_name: 关于 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 取消或X按钮 + role: '' + ui_name: 取消或X按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 添加按钮 + role: '' + ui_name: 添加按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 在新窗口中打开 + role: '' + ui_name: 在新窗口中打开 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 添加 + role: '' + ui_name: 添加 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 删除 + role: '' + ui_name: 删除 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 替换按钮 + role: '' + ui_name: 替换按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 从不 + role: '' + ui_name: 从不 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 询问确认 + role: '' + ui_name: 询问确认 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 压缩后删除原来的文件 + role: '' + ui_name: 压缩后删除原来的文件 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 提示框上转换按钮 + role: '' + ui_name: 提示框上转换按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 转换按钮 + role: '' + ui_name: 转换按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 提示框上取消按钮 + role: '' + ui_name: 提示框上取消按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 右上角x按钮 + role: '' + ui_name: 右上角x按钮 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: dock栏上图标 + role: '' + ui_name: dock栏上图标 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 右键弹出菜单 + role: '' + ui_name: 右键弹出菜单 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 信息图标 + role: '' + ui_name: 信息图标 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 +- name: 或右键菜单 + role: '' + ui_name: 或右键菜单 + desc: '' + reason: id_name/object_name 未填 (TBD),运行时无法按名定位 diff --git a/tests/at/files/hello.txt b/tests/at/files/hello.txt new file mode 100644 index 000000000..557db03de --- /dev/null +++ b/tests/at/files/hello.txt @@ -0,0 +1 @@ +Hello World diff --git a/tests/at/files/test.7z b/tests/at/files/test.7z new file mode 100644 index 000000000..d92efb3a5 Binary files /dev/null and b/tests/at/files/test.7z differ diff --git a/tests/at/files/test.tar.gz b/tests/at/files/test.tar.gz new file mode 100644 index 000000000..64341b1f2 Binary files /dev/null and b/tests/at/files/test.tar.gz differ diff --git a/tests/at/files/test.txt b/tests/at/files/test.txt new file mode 100644 index 000000000..811fcd360 --- /dev/null +++ b/tests/at/files/test.txt @@ -0,0 +1 @@ +This is a test file for deepin-compressor AT tests. diff --git a/tests/at/files/test.zip b/tests/at/files/test.zip new file mode 100644 index 000000000..6f03fb5cc Binary files /dev/null and b/tests/at/files/test.zip differ diff --git a/tests/at/yaml/elements.yaml b/tests/at/yaml/elements.yaml new file mode 100644 index 000000000..fb4397765 --- /dev/null +++ b/tests/at/yaml/elements.yaml @@ -0,0 +1,54 @@ +elements: + CheckButton: + name: 推荐选择 + role: button + CommandLinkBackButton: + name: 重 试 + role: button + CompressSettingPage_CompressButton: + name: 压 缩 + role: button + CpuComboBox: + name: 单线程 + role: combo box + HomePage_ChooseButton: + name: 选择文件 + role: button + ListEncryptionButton: + index: 1 + role: check box + NextButton: + name: 下一步 + role: button + OpenFileChooseButton: + name: 添加其他程序 + role: button + OpenWithDialog_ChooseButton: + name: 确 定 + role: button + PauseContinueButton: + name: 暂 停 + role: check box + PopupDialog_LineEdit: + index: 0 + name: DLineEditChildLineEdit + role: text + ProgressPage_CancelButton: + name: 取 消 + role: button + ReturnButton: + index: 0 + name: 返回 + role: button + ShowFileButton: + name: 查看文件 + role: button + SplitCheckBox: + name: '分卷压缩:' + role: check box + UnCompressButton: + name: 解 压 + role: button + UncompressPathButton: + name: 解压到: ~/Desktop + role: button diff --git "a/tests/at/yaml/\345\275\222\346\241\243\347\256\241\347\220\206\345\231\250/\345\275\222\346\241\243\347\256\241\347\220\206\345\231\250.suite.yaml" "b/tests/at/yaml/\345\275\222\346\241\243\347\256\241\347\220\206\345\231\250/\345\275\222\346\241\243\347\256\241\347\220\206\345\231\250.suite.yaml" new file mode 100644 index 000000000..6f3fe7599 --- /dev/null +++ "b/tests/at/yaml/\345\275\222\346\241\243\347\256\241\347\220\206\345\231\250/\345\275\222\346\241\243\347\256\241\347\220\206\345\231\250.suite.yaml" @@ -0,0 +1,531 @@ +name: 归档管理器_suite +app: deepin-compressor +module: 归档管理器 +vars: + TEST_TXT: ${TEST_FILES_DIR}/test.txt + TEST_ZIP: ${TEST_FILES_DIR}/test.zip + TEST_7Z: ${TEST_FILES_DIR}/test.7z + TEST_TARGZ: ${TEST_FILES_DIR}/test.tar.gz +setup: +- action: session_start + command: QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1 deepin-compressor + wait: 5.0 +suites: +- id: suite_归档管理器_006_s1 + name: 文件添加与选择-【归档管理器】根目录添加文件;【归档管理器】不同路径文件压缩;【归档管理器】授权提示01;【归档管理器】 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 下一步 + role: button +- id: suite_归档管理器_011_s1 + name: 压缩设置与执行-【归档管理器】压缩深路径文件;【归档管理器】压缩快捷键;【归档管理器】特殊符号命名压缩包;【归档管理器】 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 压 缩 + role: button + do: click + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 压 缩 + role: button +- id: suite_归档管理器_015_s1 + name: 解压操作-【归档管理器】解压列表打开;【归档管理器】解压列表打开2;【归档管理器】授权提示02;【归档管理器】成功界面点 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 添加其他程序 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 确 定 + role: button + do: click + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 解 压 + role: button +- id: suite_归档管理器_016_s1 + name: 解压操作-【归档管理器】提取文件取消;【归档管理器】右键解压缩;【归档管理器】右键解压到当前文件夹;【归档管理器】右键解 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: click + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 解 压 + role: button +- id: suite_归档管理器_020_s1 + name: 密码与加密-【归档管理器】[008]汉字密码加密包02;【归档管理器】[007]汉字密码加密包01;【归档管理器】密码框 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + ref: ListEncryptionButton + do: click + - step_type: action + action: keyboard_type + text: test123 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + assert_steps: + - step_type: assert + action: assert_element + ref: ListEncryptionButton +- id: suite_归档管理器_023_s1 + name: 分卷压缩-【归档管理器】分卷压缩;【归档管理器】解压分卷压缩包;【归档管理器】解压分卷压缩包2;【归档管理器】zip分卷 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: element_action + selector: + name: '分卷压缩:' + role: check box + do: click + - step_type: action + action: keyboard_type + text: '200' + - step_type: action + action: element_action + selector: + name: 压 缩 + role: button + do: click + assert_steps: + - step_type: assert + action: assert_element + selector: + name: '分卷压缩:' + role: check box +- id: suite_归档管理器_025_s1 + name: 进度暂停与取消-【归档管理器】解压速率显示;【归档管理器】压缩速率显示;【归档管理器】压缩过程中取消压缩;【归档管理器】 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 压 缩 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 暂 停 + role: check box + do: click + - step_type: action + action: element_action + selector: + name: 取 消 + role: button + do: click + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 取 消 + role: button +- id: suite_归档管理器_027_s1 + name: 导航与返回-【归档管理器】帮助手册;【归档管理器】关于 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: keyboard_press + key: Down + - step_type: action + action: keyboard_press + key: Return + - step_type: action + action: element_action + selector: + name: 返回 + role: button + index: 0 + do: click + - step_type: action + action: element_action + selector: + name: 重 试 + role: button + do: click + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 返回 + role: button + index: 0 +- id: suite_归档管理器_031_s1 + name: CPU线程设置-【归档管理器】CPU线程数-八线程;【归档管理器】CPU线程数-单线程;【归档管理器】追加压缩时候的并行 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 单线程 + role: combo box + do: click + - step_type: action + action: keyboard_press + key: Down + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 单线程 + role: combo box +- id: suite_归档管理器_032_s1 + name: 重命名操作-【归档管理器】[010]压缩包重命名;【归档管理器】文件变动提示;【归档管理器】文件默认名称重命名;【归管 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: right_click + - step_type: action + action: element_action + selector: + name: DLineEditChildLineEdit + role: text + index: 0 + do: focus + - step_type: action + action: keyboard_type + text: test + assert_steps: + - step_type: assert + action: assert_element + selector: + name: DLineEditChildLineEdit + role: text + index: 0 +- id: suite_归档管理器_033_s1 + name: 设置选项-解压后删除压缩文件与推荐选项设置 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_TXT} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 下一步 + role: button + do: click + - step_type: action + action: keyboard_press + key: Tab + - step_type: action + action: element_action + selector: + name: 推荐选择 + role: button + do: click + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 推荐选择 + role: button +- id: suite_归档管理器_034_s1 + name: 结果显示与查看-解压成功后显示文件 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 查看文件 + role: button + do: click + - step_type: action + action: screenshot + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 查看文件 + role: button +- id: suite_归档管理器_035_s1 + name: 解压操作-设置解压路径 + description: '' + steps: + - step_type: action + action: element_action + wait_for: + selector: + name: 选择文件 + timeout: 15000 + interval: 500 + selector: + name: 选择文件 + role: button + do: click + - step_type: action + action: file_dialog_select + path: ${TEST_ZIP} + wait_after: 1000 + - step_type: action + action: element_action + selector: + name: 解 压 + role: button + do: click + - step_type: action + action: element_action + selector: + name: 解压到: ~/Desktop + role: button + do: click + - step_type: action + action: keyboard_type + text: /tmp/test + - step_type: action + action: keyboard_press + key: Return + assert_steps: + - step_type: assert + action: assert_element + selector: + name: 解压到: ~/Desktop + role: button +teardown: +- action: session_stop