mirror of
https://github.com/status-im/desktop-ui-tests.git
synced 2025-01-11 21:34:15 +00:00
chore(tst_get_started_modal.qml): add tests
This commit is contained in:
parent
0da479783a
commit
806d686f9c
@ -1,11 +1,13 @@
|
||||
import QtQuick 2.14
|
||||
|
||||
import "../status-desktop/ui/shared" as Shared
|
||||
import "../status-desktop/ui/shared/popups" as SharedPopups
|
||||
import "../status-desktop/ui/shared/panels" as SharedPanels
|
||||
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
||||
property Shared.ModalPopup target: null
|
||||
property SharedPopups.ModalPopup target: null
|
||||
|
||||
property var header
|
||||
property var contentItem
|
||||
@ -13,10 +15,9 @@ QtObject {
|
||||
|
||||
property Helpers __helpers: Helpers {}
|
||||
|
||||
Component {
|
||||
id: headerComp
|
||||
property var headerComp: Component {
|
||||
QtObject {
|
||||
property Shared.StyledText title: null
|
||||
property SharedPanels.StyledText title: null
|
||||
property var closeButton: null
|
||||
}
|
||||
}
|
||||
@ -37,11 +38,10 @@ QtObject {
|
||||
return null
|
||||
}
|
||||
|
||||
Component {
|
||||
id: cbComponent
|
||||
property var cbComponent: Component {
|
||||
QtObject {
|
||||
property Rectangle background: null
|
||||
property Shared.SVGImage icon: null
|
||||
property SharedPanels.SVGImage icon: null
|
||||
property MouseArea sensor: null
|
||||
|
||||
function click() {
|
||||
|
@ -5,26 +5,19 @@ import QtTest 1.14
|
||||
import "base"
|
||||
import "status-desktop/ui/app/AppLayouts/Onboarding/popups" as DesktopComponents
|
||||
|
||||
|
||||
WindowTestCase {
|
||||
name: "GetStartedModal"
|
||||
when: windowShown
|
||||
name: "GetStartedModal tests"
|
||||
|
||||
Helpers { id: helpers }
|
||||
|
||||
|
||||
ChatsModelData {
|
||||
id: chatsModel
|
||||
}
|
||||
LegacyModalsHelpers { id: legacyHelpers }
|
||||
|
||||
|
||||
Component {
|
||||
id: popupComponent
|
||||
DesktopComponents.BeforeGetStartedModal {
|
||||
id: beforeGetStartedModal
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function test_case1_BeforeGetStartedModal_height_width() {
|
||||
|
||||
@ -38,19 +31,32 @@ WindowTestCase {
|
||||
}
|
||||
|
||||
|
||||
function test_case2_BeforeGetStartedModal_button() {
|
||||
function test_case2_BeforeGetStartedModal_button_disabled() {
|
||||
|
||||
var beforeGetStartedModal = popupComponent.createObject(window)
|
||||
beforeGetStartedModal.open()
|
||||
beforeGetStartedModal.title = "Before you get started ..."
|
||||
wait(2000)
|
||||
var getStartedButtonExists = helpers.checkIfItemExists(beforeGetStartedModal, 340, 260)
|
||||
verify(getStartedButtonExists, true)
|
||||
var getStartedButton = legacyHelpers.findInContent("getStartedStatusButton")
|
||||
mouseClick(getStartedButton, 2, 2, Qt.LeftButton)
|
||||
verify(getStartedButton.enabled = false, "Get Started Button is enabled")
|
||||
beforeGetStartedModal.destroy()
|
||||
}
|
||||
|
||||
|
||||
|
||||
function test_case3_BeforeGetStartedModal_button_enabled() {
|
||||
var beforeGetStartedModal = popupComponent.createObject(window)
|
||||
beforeGetStartedModal.open()
|
||||
wait(2000)
|
||||
var acknowledgeCheckBox = legacyHelpers.findInContent("acknowledgeCheckBox")
|
||||
mouseClick(acknowledgeCheckBox, 2, 2, Qt.LeftButton)
|
||||
var termsOfUseCheckBox = legacyHelpers.findInContent("termsOfUseCheckBox")
|
||||
mouseClick(termsOfUseCheckBox, 2, 2, Qt.LeftButton)
|
||||
var getStartedButton = legacyHelpers.findInContent("getStartedStatusButton")
|
||||
verify(getStartedButton.enabled = false, "Get Started Button is enabled")
|
||||
mouseClick(getStartedButton, 2, 2, Qt.LeftButton)
|
||||
beforeGetStartedModal.destroy()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,7 +8,8 @@ DEFINES += PROJECT_PATH=\"$${PWD}\"
|
||||
|
||||
#DISTFILES += $$
|
||||
|
||||
DISTFILES += $$files("$$PWD/*.qml", true)
|
||||
DISTFILES += $$files("$$PWD/*.qml", true) \
|
||||
tst_statusChatListCategoryItemButton.qml
|
||||
|
||||
QML_IMPORT_PATH += status-desktop/ui/StatusQ/src
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user