mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-10 17:55:40 +02:00
tests/qml: fix undefined references to appWindow
GitLab: #1780 Change-Id: I166f68c7abdf0f21d8d5dcec85e377c27de798a3
This commit is contained in:
parent
6c35561817
commit
84a59889e3
3 changed files with 228 additions and 222 deletions
|
@ -28,34 +28,36 @@ import "../../../src/app/mainview"
|
||||||
import "../../../src/app/mainview/components"
|
import "../../../src/app/mainview/components"
|
||||||
import "../../../src/app/commoncomponents"
|
import "../../../src/app/commoncomponents"
|
||||||
|
|
||||||
ListSelectionView {
|
TestWrapper {
|
||||||
id: viewNode
|
ListSelectionView {
|
||||||
objectName: "ConversationView"
|
id: viewNode
|
||||||
managed: false
|
objectName: "ConversationView"
|
||||||
|
managed: false
|
||||||
|
|
||||||
leftPaneItem: Rectangle {}
|
leftPaneItem: Rectangle {}
|
||||||
|
|
||||||
rightPaneItem: ChatView {
|
rightPaneItem: ChatView {
|
||||||
id: uut
|
id: uut
|
||||||
|
|
||||||
inCallView: false
|
inCallView: false
|
||||||
|
|
||||||
TestCase {
|
TestCase {
|
||||||
name: "Check basic visibility for header buttons"
|
name: "Check basic visibility for header buttons"
|
||||||
function test_checkBasicVisibility() {
|
function test_checkBasicVisibility() {
|
||||||
var chatviewHeader = findChild(uut, "chatViewHeader")
|
var chatviewHeader = findChild(uut, "chatViewHeader")
|
||||||
var detailsButton = findChild(chatviewHeader, "detailsButton")
|
var detailsButton = findChild(chatviewHeader, "detailsButton")
|
||||||
compare(detailsButton.visible, true)
|
compare(detailsButton.visible, true)
|
||||||
|
|
||||||
var chatViewFooter = findChild(uut, "chatViewFooter")
|
var chatViewFooter = findChild(uut, "chatViewFooter")
|
||||||
CurrentConversation.isTemporary = true
|
CurrentConversation.isTemporary = true
|
||||||
compare(chatViewFooter.visible, true)
|
compare(chatViewFooter.visible, true)
|
||||||
CurrentConversation.isTemporary = false
|
CurrentConversation.isTemporary = false
|
||||||
CurrentConversation.isRequest = true
|
CurrentConversation.isRequest = true
|
||||||
compare(chatViewFooter.visible, false)
|
compare(chatViewFooter.visible, false)
|
||||||
CurrentConversation.isRequest = false
|
CurrentConversation.isRequest = false
|
||||||
CurrentConversation.needsSyncing = true
|
CurrentConversation.needsSyncing = true
|
||||||
compare(chatViewFooter.visible, false)
|
compare(chatViewFooter.visible, false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,40 +26,42 @@ import net.jami.Enums 1.1
|
||||||
import "../../../src/app/settingsview"
|
import "../../../src/app/settingsview"
|
||||||
import "../../../src/app/commoncomponents"
|
import "../../../src/app/commoncomponents"
|
||||||
|
|
||||||
SettingsSidePanel {
|
TestWrapper {
|
||||||
id: uut
|
SettingsSidePanel {
|
||||||
|
id: uut
|
||||||
|
|
||||||
SignalSpy {
|
SignalSpy {
|
||||||
id: spyUpdated
|
id: spyUpdated
|
||||||
|
|
||||||
target: uut
|
target: uut
|
||||||
signalName: "updated"
|
signalName: "updated"
|
||||||
}
|
|
||||||
|
|
||||||
SignalSpy {
|
|
||||||
id: spyChangeLang
|
|
||||||
|
|
||||||
target: UtilsAdapter
|
|
||||||
signalName: "changeLanguage"
|
|
||||||
}
|
|
||||||
|
|
||||||
TestCase {
|
|
||||||
name: "WelcomePage to different account creation page and return back"
|
|
||||||
when: windowShown
|
|
||||||
|
|
||||||
function test_retranslate() {
|
|
||||||
spyUpdated.clear()
|
|
||||||
UtilsAdapter.setAppValue(Settings.Key.LANG, "en_EN")
|
|
||||||
spyChangeLang.wait(1000)
|
|
||||||
compare(spyChangeLang.count, 1)
|
|
||||||
spyUpdated.wait(1000)
|
|
||||||
compare(spyUpdated.count, 1)
|
|
||||||
UtilsAdapter.setAppValue(Settings.Key.LANG, "fr")
|
|
||||||
spyChangeLang.wait(1000)
|
|
||||||
compare(spyChangeLang.count, 2)
|
|
||||||
spyUpdated.wait(1000)
|
|
||||||
compare(spyUpdated.count, 2)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
SignalSpy {
|
||||||
|
id: spyChangeLang
|
||||||
|
|
||||||
|
target: UtilsAdapter
|
||||||
|
signalName: "changeLanguage"
|
||||||
|
}
|
||||||
|
|
||||||
|
TestCase {
|
||||||
|
name: "WelcomePage to different account creation page and return back"
|
||||||
|
when: windowShown
|
||||||
|
|
||||||
|
function test_retranslate() {
|
||||||
|
spyUpdated.clear()
|
||||||
|
UtilsAdapter.setAppValue(Settings.Key.LANG, "en_EN")
|
||||||
|
spyChangeLang.wait(1000)
|
||||||
|
compare(spyChangeLang.count, 1)
|
||||||
|
spyUpdated.wait(1000)
|
||||||
|
compare(spyUpdated.count, 1)
|
||||||
|
UtilsAdapter.setAppValue(Settings.Key.LANG, "fr")
|
||||||
|
spyChangeLang.wait(1000)
|
||||||
|
compare(spyChangeLang.count, 2)
|
||||||
|
spyUpdated.wait(1000)
|
||||||
|
compare(spyUpdated.count, 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,192 +26,194 @@ import net.jami.Enums 1.1
|
||||||
import "../../../src/app/wizardview"
|
import "../../../src/app/wizardview"
|
||||||
import "../../../src/app/commoncomponents"
|
import "../../../src/app/commoncomponents"
|
||||||
|
|
||||||
WizardView {
|
TestWrapper {
|
||||||
id: uut
|
WizardView {
|
||||||
|
id: uut
|
||||||
|
|
||||||
width: 400
|
width: 400
|
||||||
height: 600
|
height: 600
|
||||||
|
|
||||||
function clearSignalSpy() {
|
function clearSignalSpy() {
|
||||||
spyAccountIsReady.clear()
|
spyAccountIsReady.clear()
|
||||||
spyAccountIsRemoved.clear()
|
spyAccountIsRemoved.clear()
|
||||||
spyAccountConfigFinalized.clear()
|
spyAccountConfigFinalized.clear()
|
||||||
spyReportFailure.clear()
|
spyReportFailure.clear()
|
||||||
spyCloseWizardView.clear()
|
spyCloseWizardView.clear()
|
||||||
|
|
||||||
spyBackButtonVisible.target = undefined
|
spyBackButtonVisible.target = undefined
|
||||||
}
|
|
||||||
|
|
||||||
SignalSpy {
|
|
||||||
id: spyAccountIsReady
|
|
||||||
|
|
||||||
target: WizardViewStepModel
|
|
||||||
signalName: "accountIsReady"
|
|
||||||
}
|
|
||||||
|
|
||||||
SignalSpy {
|
|
||||||
id: spyAccountIsRemoved
|
|
||||||
|
|
||||||
target: AccountAdapter
|
|
||||||
signalName: "accountRemoved"
|
|
||||||
}
|
|
||||||
|
|
||||||
SignalSpy {
|
|
||||||
id: spyAccountStatusChanged
|
|
||||||
|
|
||||||
target: AccountAdapter
|
|
||||||
signalName: "accountStatusChanged"
|
|
||||||
}
|
|
||||||
|
|
||||||
SignalSpy {
|
|
||||||
id: spyAccountConfigFinalized
|
|
||||||
|
|
||||||
target: AccountAdapter
|
|
||||||
signalName: "accountConfigFinalized"
|
|
||||||
}
|
|
||||||
|
|
||||||
SignalSpy {
|
|
||||||
id: spyReportFailure
|
|
||||||
|
|
||||||
target: AccountAdapter
|
|
||||||
signalName: "reportFailure"
|
|
||||||
}
|
|
||||||
|
|
||||||
SignalSpy {
|
|
||||||
id: spyCloseWizardView
|
|
||||||
|
|
||||||
target: WizardViewStepModel
|
|
||||||
signalName: "closeWizardView"
|
|
||||||
}
|
|
||||||
|
|
||||||
SignalSpy {
|
|
||||||
id: spyBackButtonVisible
|
|
||||||
|
|
||||||
signalName: "visibleChanged"
|
|
||||||
}
|
|
||||||
|
|
||||||
TestCase {
|
|
||||||
name: "WelcomePage to different account creation page and return back"
|
|
||||||
when: windowShown
|
|
||||||
|
|
||||||
function test_welcomePageStepInStepOut() {
|
|
||||||
var controlPanelStackView = findChild(uut, "controlPanelStackView")
|
|
||||||
|
|
||||||
var welcomePage = findChild(uut, "welcomePage")
|
|
||||||
var createAccountPage = findChild(uut, "createAccountPage")
|
|
||||||
var importFromDevicePage = findChild(uut, "importFromDevicePage")
|
|
||||||
var importFromBackupPage = findChild(uut, "importFromBackupPage")
|
|
||||||
var connectToAccountManagerPage = findChild(uut, "connectToAccountManagerPage")
|
|
||||||
var createSIPAccountPage = findChild(uut, "createSIPAccountPage")
|
|
||||||
|
|
||||||
// Go to createAccount page
|
|
||||||
WizardViewStepModel.startAccountCreationFlow(
|
|
||||||
WizardViewStepModel.AccountCreationOption.CreateJamiAccount)
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
createAccountPage)
|
|
||||||
WizardViewStepModel.previousStep()
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
welcomePage)
|
|
||||||
|
|
||||||
// Go to CreateRendezVous page
|
|
||||||
WizardViewStepModel.startAccountCreationFlow(
|
|
||||||
WizardViewStepModel.AccountCreationOption.CreateRendezVous)
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
createAccountPage)
|
|
||||||
WizardViewStepModel.previousStep()
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
welcomePage)
|
|
||||||
|
|
||||||
// Go to CreateRendezVous page
|
|
||||||
WizardViewStepModel.startAccountCreationFlow(
|
|
||||||
WizardViewStepModel.AccountCreationOption.ImportFromDevice)
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
importFromDevicePage)
|
|
||||||
WizardViewStepModel.previousStep()
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
welcomePage)
|
|
||||||
|
|
||||||
// Go to ImportFromBackup page
|
|
||||||
WizardViewStepModel.startAccountCreationFlow(
|
|
||||||
WizardViewStepModel.AccountCreationOption.ImportFromBackup)
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
importFromBackupPage)
|
|
||||||
WizardViewStepModel.previousStep()
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
welcomePage)
|
|
||||||
|
|
||||||
// Go to ConnectToAccountManager page
|
|
||||||
WizardViewStepModel.startAccountCreationFlow(
|
|
||||||
WizardViewStepModel.AccountCreationOption.ConnectToAccountManager)
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
connectToAccountManagerPage)
|
|
||||||
WizardViewStepModel.previousStep()
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
welcomePage)
|
|
||||||
|
|
||||||
// Go to CreateSipAccount page
|
|
||||||
WizardViewStepModel.startAccountCreationFlow(
|
|
||||||
WizardViewStepModel.AccountCreationOption.CreateSipAccount)
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
createSIPAccountPage)
|
|
||||||
WizardViewStepModel.previousStep()
|
|
||||||
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
|
||||||
welcomePage)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
TestCase {
|
SignalSpy {
|
||||||
name: "Create Sip account ui flow"
|
id: spyAccountIsReady
|
||||||
when: windowShown
|
|
||||||
|
|
||||||
function test_createSipAccountUiFlow() {
|
target: WizardViewStepModel
|
||||||
uut.clearSignalSpy()
|
signalName: "accountIsReady"
|
||||||
|
}
|
||||||
|
|
||||||
var controlPanelStackView = findChild(uut, "controlPanelStackView")
|
SignalSpy {
|
||||||
|
id: spyAccountIsRemoved
|
||||||
|
|
||||||
var welcomePage = findChild(uut, "welcomePage")
|
target: AccountAdapter
|
||||||
var createSIPAccountPage = findChild(uut, "createSIPAccountPage")
|
signalName: "accountRemoved"
|
||||||
|
}
|
||||||
|
|
||||||
var sipUsernameEdit = findChild(createSIPAccountPage, "sipUsernameEdit")
|
SignalSpy {
|
||||||
var sipPasswordEdit = findChild(createSIPAccountPage, "sipPasswordEdit")
|
id: spyAccountStatusChanged
|
||||||
var sipServernameEdit = findChild(createSIPAccountPage, "sipServernameEdit")
|
|
||||||
var createAccountButton = findChild(createSIPAccountPage, "createSIPAccountButton")
|
|
||||||
|
|
||||||
// Go to createSipAccount page
|
target: AccountAdapter
|
||||||
WizardViewStepModel.startAccountCreationFlow(
|
signalName: "accountStatusChanged"
|
||||||
WizardViewStepModel.AccountCreationOption.CreateSipAccount)
|
}
|
||||||
|
|
||||||
// Set up paras
|
SignalSpy {
|
||||||
var userName = "testUserName"
|
id: spyAccountConfigFinalized
|
||||||
var serverName = "testServerName"
|
|
||||||
var password = "testPassword"
|
|
||||||
var proxy = "testProxy"
|
|
||||||
|
|
||||||
sipUsernameEdit.dynamicText = userName
|
target: AccountAdapter
|
||||||
sipPasswordEdit.dynamicText = password
|
signalName: "accountConfigFinalized"
|
||||||
sipServernameEdit.dynamicText = serverName
|
}
|
||||||
|
|
||||||
createAccountButton.clicked()
|
SignalSpy {
|
||||||
|
id: spyReportFailure
|
||||||
|
|
||||||
// Wait until the account creation is finished
|
target: AccountAdapter
|
||||||
spyAccountIsReady.wait()
|
signalName: "reportFailure"
|
||||||
compare(spyAccountIsReady.count, 1)
|
}
|
||||||
|
|
||||||
// Check if paras match with setup
|
SignalSpy {
|
||||||
compare(CurrentAccount.username, userName)
|
id: spyCloseWizardView
|
||||||
compare(CurrentAccount.hostname, serverName)
|
|
||||||
compare(CurrentAccount.password, password)
|
|
||||||
|
|
||||||
WizardViewStepModel.nextStep()
|
target: WizardViewStepModel
|
||||||
|
signalName: "closeWizardView"
|
||||||
|
}
|
||||||
|
|
||||||
spyCloseWizardView.wait()
|
SignalSpy {
|
||||||
compare(spyCloseWizardView.count, 1)
|
id: spyBackButtonVisible
|
||||||
|
|
||||||
AccountAdapter.deleteCurrentAccount()
|
signalName: "visibleChanged"
|
||||||
|
}
|
||||||
|
|
||||||
// Wait until the account removal is finished
|
TestCase {
|
||||||
spyAccountIsRemoved.wait()
|
name: "WelcomePage to different account creation page and return back"
|
||||||
compare(spyAccountIsRemoved.count, 1)
|
when: windowShown
|
||||||
|
|
||||||
|
function test_welcomePageStepInStepOut() {
|
||||||
|
var controlPanelStackView = findChild(uut, "controlPanelStackView")
|
||||||
|
|
||||||
|
var welcomePage = findChild(uut, "welcomePage")
|
||||||
|
var createAccountPage = findChild(uut, "createAccountPage")
|
||||||
|
var importFromDevicePage = findChild(uut, "importFromDevicePage")
|
||||||
|
var importFromBackupPage = findChild(uut, "importFromBackupPage")
|
||||||
|
var connectToAccountManagerPage = findChild(uut, "connectToAccountManagerPage")
|
||||||
|
var createSIPAccountPage = findChild(uut, "createSIPAccountPage")
|
||||||
|
|
||||||
|
// Go to createAccount page
|
||||||
|
WizardViewStepModel.startAccountCreationFlow(
|
||||||
|
WizardViewStepModel.AccountCreationOption.CreateJamiAccount)
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
createAccountPage)
|
||||||
|
WizardViewStepModel.previousStep()
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
welcomePage)
|
||||||
|
|
||||||
|
// Go to CreateRendezVous page
|
||||||
|
WizardViewStepModel.startAccountCreationFlow(
|
||||||
|
WizardViewStepModel.AccountCreationOption.CreateRendezVous)
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
createAccountPage)
|
||||||
|
WizardViewStepModel.previousStep()
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
welcomePage)
|
||||||
|
|
||||||
|
// Go to CreateRendezVous page
|
||||||
|
WizardViewStepModel.startAccountCreationFlow(
|
||||||
|
WizardViewStepModel.AccountCreationOption.ImportFromDevice)
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
importFromDevicePage)
|
||||||
|
WizardViewStepModel.previousStep()
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
welcomePage)
|
||||||
|
|
||||||
|
// Go to ImportFromBackup page
|
||||||
|
WizardViewStepModel.startAccountCreationFlow(
|
||||||
|
WizardViewStepModel.AccountCreationOption.ImportFromBackup)
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
importFromBackupPage)
|
||||||
|
WizardViewStepModel.previousStep()
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
welcomePage)
|
||||||
|
|
||||||
|
// Go to ConnectToAccountManager page
|
||||||
|
WizardViewStepModel.startAccountCreationFlow(
|
||||||
|
WizardViewStepModel.AccountCreationOption.ConnectToAccountManager)
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
connectToAccountManagerPage)
|
||||||
|
WizardViewStepModel.previousStep()
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
welcomePage)
|
||||||
|
|
||||||
|
// Go to CreateSipAccount page
|
||||||
|
WizardViewStepModel.startAccountCreationFlow(
|
||||||
|
WizardViewStepModel.AccountCreationOption.CreateSipAccount)
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
createSIPAccountPage)
|
||||||
|
WizardViewStepModel.previousStep()
|
||||||
|
compare(controlPanelStackView.children[controlPanelStackView.currentIndex],
|
||||||
|
welcomePage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TestCase {
|
||||||
|
name: "Create Sip account ui flow"
|
||||||
|
when: windowShown
|
||||||
|
|
||||||
|
function test_createSipAccountUiFlow() {
|
||||||
|
uut.clearSignalSpy()
|
||||||
|
|
||||||
|
var controlPanelStackView = findChild(uut, "controlPanelStackView")
|
||||||
|
|
||||||
|
var welcomePage = findChild(uut, "welcomePage")
|
||||||
|
var createSIPAccountPage = findChild(uut, "createSIPAccountPage")
|
||||||
|
|
||||||
|
var sipUsernameEdit = findChild(createSIPAccountPage, "sipUsernameEdit")
|
||||||
|
var sipPasswordEdit = findChild(createSIPAccountPage, "sipPasswordEdit")
|
||||||
|
var sipServernameEdit = findChild(createSIPAccountPage, "sipServernameEdit")
|
||||||
|
var createAccountButton = findChild(createSIPAccountPage, "createSIPAccountButton")
|
||||||
|
|
||||||
|
// Go to createSipAccount page
|
||||||
|
WizardViewStepModel.startAccountCreationFlow(
|
||||||
|
WizardViewStepModel.AccountCreationOption.CreateSipAccount)
|
||||||
|
|
||||||
|
// Set up paras
|
||||||
|
var userName = "testUserName"
|
||||||
|
var serverName = "testServerName"
|
||||||
|
var password = "testPassword"
|
||||||
|
var proxy = "testProxy"
|
||||||
|
|
||||||
|
sipUsernameEdit.dynamicText = userName
|
||||||
|
sipPasswordEdit.dynamicText = password
|
||||||
|
sipServernameEdit.dynamicText = serverName
|
||||||
|
|
||||||
|
createAccountButton.clicked()
|
||||||
|
|
||||||
|
// Wait until the account creation is finished
|
||||||
|
spyAccountIsReady.wait()
|
||||||
|
compare(spyAccountIsReady.count, 1)
|
||||||
|
|
||||||
|
// Check if paras match with setup
|
||||||
|
compare(CurrentAccount.username, userName)
|
||||||
|
compare(CurrentAccount.hostname, serverName)
|
||||||
|
compare(CurrentAccount.password, password)
|
||||||
|
|
||||||
|
WizardViewStepModel.nextStep()
|
||||||
|
|
||||||
|
spyCloseWizardView.wait()
|
||||||
|
compare(spyCloseWizardView.count, 1)
|
||||||
|
|
||||||
|
AccountAdapter.deleteCurrentAccount()
|
||||||
|
|
||||||
|
// Wait until the account removal is finished
|
||||||
|
spyAccountIsRemoved.wait()
|
||||||
|
compare(spyAccountIsRemoved.count, 1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue