2021-10-14 09:21:46 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Window 2.14
|
|
|
|
import QtTest 1.14
|
|
|
|
|
|
|
|
import "base"
|
2021-10-18 12:31:21 +00:00
|
|
|
import "status-desktop/ui/app/AppLayouts/Onboarding/popups" as DesktopComponents
|
2021-10-14 09:21:46 +00:00
|
|
|
|
|
|
|
WindowTestCase {
|
2021-10-22 10:29:39 +00:00
|
|
|
name: "GetStartedModal tests"
|
2021-10-14 09:21:46 +00:00
|
|
|
|
2021-10-22 10:29:39 +00:00
|
|
|
LegacyModalsHelpers { id: legacyHelpers }
|
2021-10-14 09:21:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: popupComponent
|
|
|
|
DesktopComponents.BeforeGetStartedModal {
|
|
|
|
id: beforeGetStartedModal
|
|
|
|
}
|
|
|
|
|
2021-10-22 10:29:39 +00:00
|
|
|
}
|
2021-10-14 09:21:46 +00:00
|
|
|
|
2021-10-15 14:06:35 +00:00
|
|
|
function test_case1_BeforeGetStartedModal_height_width() {
|
2021-10-14 09:21:46 +00:00
|
|
|
|
|
|
|
var beforeGetStartedModal = popupComponent.createObject(window)
|
|
|
|
beforeGetStartedModal.open()
|
|
|
|
compare(beforeGetStartedModal.height, 318, "height should be 318")
|
|
|
|
compare(beforeGetStartedModal.width, 480, "width should be 480")
|
2021-10-15 14:06:35 +00:00
|
|
|
beforeGetStartedModal.destroy()
|
|
|
|
}
|
|
|
|
|
2021-10-15 12:48:53 +00:00
|
|
|
|
2021-10-22 10:29:39 +00:00
|
|
|
function test_case2_BeforeGetStartedModal_button_disabled() {
|
2021-10-15 12:48:53 +00:00
|
|
|
|
2021-10-15 14:06:35 +00:00
|
|
|
var beforeGetStartedModal = popupComponent.createObject(window)
|
|
|
|
beforeGetStartedModal.open()
|
2021-10-26 08:10:09 +00:00
|
|
|
var getStartedButton = findChild(beforeGetStartedModal, "getStartedStatusButton")
|
|
|
|
print (getStartedButton)
|
2021-10-25 21:08:15 +00:00
|
|
|
mouseClick(getStartedButton, getStartedButton.width/2, getStartedButton.height/2, Qt.LeftButton)
|
2021-10-25 15:33:21 +00:00
|
|
|
verify(!getStartedButton.enabled, "Get Started Button is enabled")
|
2021-10-14 09:21:46 +00:00
|
|
|
beforeGetStartedModal.destroy()
|
2021-10-15 14:06:35 +00:00
|
|
|
}
|
|
|
|
|
2021-10-22 10:29:39 +00:00
|
|
|
function test_case3_BeforeGetStartedModal_button_enabled() {
|
|
|
|
var beforeGetStartedModal = popupComponent.createObject(window)
|
|
|
|
beforeGetStartedModal.open()
|
2021-10-25 15:33:21 +00:00
|
|
|
legacyHelpers.target = beforeGetStartedModal
|
2021-10-22 10:29:39 +00:00
|
|
|
var acknowledgeCheckBox = legacyHelpers.findInContent("acknowledgeCheckBox")
|
2021-10-25 15:33:21 +00:00
|
|
|
mouseClick(acknowledgeCheckBox, acknowledgeCheckBox.width/2, acknowledgeCheckBox.height/2, Qt.LeftButton)
|
2021-10-22 10:29:39 +00:00
|
|
|
var termsOfUseCheckBox = legacyHelpers.findInContent("termsOfUseCheckBox")
|
2021-10-25 15:33:21 +00:00
|
|
|
mouseClick(termsOfUseCheckBox, termsOfUseCheckBox.width/2, termsOfUseCheckBox.height/2, Qt.LeftButton)
|
2021-10-26 08:10:09 +00:00
|
|
|
var getStartedButton = findChild(beforeGetStartedModal, "getStartedStatusButton")
|
|
|
|
verify(getStartedButton.enabled, "Get Started Button is disabled")
|
|
|
|
wait(2000)
|
2021-10-25 21:08:15 +00:00
|
|
|
mouseClick(getStartedButton, getStartedButton.width/2, getStartedButton.height/2, Qt.LeftButton)
|
2021-10-22 10:29:39 +00:00
|
|
|
beforeGetStartedModal.destroy()
|
2021-10-14 09:21:46 +00:00
|
|
|
}
|
|
|
|
|
2021-10-25 21:08:15 +00:00
|
|
|
function test_case4_beforeGetStartedModal_TOU_click() {
|
|
|
|
var beforeGetStartedModal = popupComponent.createObject(window)
|
|
|
|
beforeGetStartedModal.open()
|
2021-10-26 08:10:09 +00:00
|
|
|
//legacyHelpers.target = beforeGetStartedModal
|
|
|
|
var termsOfUseLink = findChild(beforeGetStartedModal, "termsOfUseCheckBox")
|
2021-10-25 21:08:15 +00:00
|
|
|
mouseClick(termsOfUseLink, 2, 2, Qt.LeftButton)
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_case5_beforeGetStartedModal_privacy_policy_click() {
|
|
|
|
var beforeGetStartedModal = popupComponent.createObject(window)
|
|
|
|
beforeGetStartedModal.open()
|
2021-10-26 08:10:09 +00:00
|
|
|
//legacyHelpers.target = beforeGetStartedModal
|
2021-10-25 21:08:15 +00:00
|
|
|
var privacyPolicyLink = findChild(beforeGetStartedModal, "privacyPolicyLink")
|
|
|
|
mouseClick(privacyPolicyLink, 2, 2, Qt.LeftButton)
|
|
|
|
}
|
|
|
|
|
2021-10-22 10:29:39 +00:00
|
|
|
}
|
|
|
|
|
2021-10-14 09:21:46 +00:00
|
|
|
|