Merge branch 'develop' into feature/fga/feature_template
This commit is contained in:
commit
add5d4a5bf
10 changed files with 133 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ dependencies {
|
||||||
implementation(project(":libraries:matrix"))
|
implementation(project(":libraries:matrix"))
|
||||||
implementation(project(":libraries:designsystem"))
|
implementation(project(":libraries:designsystem"))
|
||||||
implementation(project(":libraries:elementresources"))
|
implementation(project(":libraries:elementresources"))
|
||||||
|
implementation(project(":libraries:testtags"))
|
||||||
implementation(libs.appyx.core)
|
implementation(libs.appyx.core)
|
||||||
implementation(project(":libraries:ui-strings"))
|
implementation(project(":libraries:ui-strings"))
|
||||||
ksp(libs.showkase.processor)
|
ksp(libs.showkase.processor)
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,8 @@ import io.element.android.x.core.compose.textFieldState
|
||||||
import io.element.android.x.designsystem.components.VectorIcon
|
import io.element.android.x.designsystem.components.VectorIcon
|
||||||
import io.element.android.x.features.login.R
|
import io.element.android.x.features.login.R
|
||||||
import io.element.android.x.features.login.error.changeServerError
|
import io.element.android.x.features.login.error.changeServerError
|
||||||
|
import io.element.android.x.libraries.testtags.TestTags
|
||||||
|
import io.element.android.x.libraries.testtags.testTag
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ChangeServerView(
|
fun ChangeServerView(
|
||||||
|
|
@ -129,6 +131,7 @@ fun ChangeServerView(
|
||||||
value = homeserverFieldState,
|
value = homeserverFieldState,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.testTag(TestTags.changeServerServer)
|
||||||
.padding(top = 200.dp),
|
.padding(top = 200.dp),
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
homeserverFieldState = it
|
homeserverFieldState = it
|
||||||
|
|
@ -162,6 +165,7 @@ fun ChangeServerView(
|
||||||
enabled = state.submitEnabled,
|
enabled = state.submitEnabled,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.testTag(TestTags.changeServerContinue)
|
||||||
.padding(top = 44.dp)
|
.padding(top = 44.dp)
|
||||||
) {
|
) {
|
||||||
Text(text = "Continue")
|
Text(text = "Continue")
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import io.element.android.x.core.compose.textFieldState
|
import io.element.android.x.core.compose.textFieldState
|
||||||
import io.element.android.x.features.login.error.loginError
|
import io.element.android.x.features.login.error.loginError
|
||||||
|
import io.element.android.x.libraries.testtags.TestTags
|
||||||
|
import io.element.android.x.libraries.testtags.testTag
|
||||||
import io.element.android.x.matrix.core.SessionId
|
import io.element.android.x.matrix.core.SessionId
|
||||||
import io.element.android.x.ui.strings.R as StringR
|
import io.element.android.x.ui.strings.R as StringR
|
||||||
|
|
||||||
|
|
@ -127,6 +129,7 @@ fun LoginRootScreen(
|
||||||
onClick = onChangeServer,
|
onClick = onChangeServer,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.CenterEnd)
|
.align(Alignment.CenterEnd)
|
||||||
|
.testTag(TestTags.loginChangeServer)
|
||||||
.padding(top = 8.dp, end = 8.dp),
|
.padding(top = 8.dp, end = 8.dp),
|
||||||
content = {
|
content = {
|
||||||
Text(text = "Change")
|
Text(text = "Change")
|
||||||
|
|
@ -137,6 +140,7 @@ fun LoginRootScreen(
|
||||||
value = loginFieldState,
|
value = loginFieldState,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.testTag(TestTags.loginEmailUsername)
|
||||||
.padding(top = 60.dp),
|
.padding(top = 60.dp),
|
||||||
label = {
|
label = {
|
||||||
Text(text = stringResource(id = StringR.string.login_signin_username_hint))
|
Text(text = stringResource(id = StringR.string.login_signin_username_hint))
|
||||||
|
|
@ -159,6 +163,7 @@ fun LoginRootScreen(
|
||||||
value = passwordFieldState,
|
value = passwordFieldState,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.testTag(TestTags.loginPassword)
|
||||||
.padding(top = 24.dp),
|
.padding(top = 24.dp),
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
passwordFieldState = it
|
passwordFieldState = it
|
||||||
|
|
@ -202,6 +207,7 @@ fun LoginRootScreen(
|
||||||
enabled = state.submitEnabled,
|
enabled = state.submitEnabled,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.testTag(TestTags.loginContinue)
|
||||||
.padding(vertical = 32.dp)
|
.padding(vertical = 32.dp)
|
||||||
) {
|
) {
|
||||||
Text(text = "Continue")
|
Text(text = "Continue")
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ dependencies {
|
||||||
implementation(project(":libraries:ui-strings"))
|
implementation(project(":libraries:ui-strings"))
|
||||||
implementation(project(":libraries:designsystem"))
|
implementation(project(":libraries:designsystem"))
|
||||||
implementation(project(":libraries:architecture"))
|
implementation(project(":libraries:architecture"))
|
||||||
|
implementation(project(":libraries:testtags"))
|
||||||
implementation(libs.accompanist.pager)
|
implementation(libs.accompanist.pager)
|
||||||
implementation(libs.accompanist.pagerindicator)
|
implementation(libs.accompanist.pagerindicator)
|
||||||
implementation(libs.appyx.core)
|
implementation(libs.appyx.core)
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,8 @@ import com.google.accompanist.pager.HorizontalPager
|
||||||
import com.google.accompanist.pager.HorizontalPagerIndicator
|
import com.google.accompanist.pager.HorizontalPagerIndicator
|
||||||
import com.google.accompanist.pager.rememberPagerState
|
import com.google.accompanist.pager.rememberPagerState
|
||||||
import io.element.android.x.designsystem.components.VectorButton
|
import io.element.android.x.designsystem.components.VectorButton
|
||||||
|
import io.element.android.x.libraries.testtags.TestTags
|
||||||
|
import io.element.android.x.libraries.testtags.testTag
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import io.element.android.x.ui.strings.R as StringR
|
import io.element.android.x.ui.strings.R as StringR
|
||||||
|
|
@ -127,6 +129,7 @@ fun OnBoardingScreen(
|
||||||
enabled = true,
|
enabled = true,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(CenterHorizontally)
|
.align(CenterHorizontally)
|
||||||
|
.testTag(TestTags.onBoardingSignIn)
|
||||||
.padding(top = 16.dp)
|
.padding(top = 16.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
libraries/testtags/build.gradle.kts
Normal file
23
libraries/testtags/build.gradle.kts
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("io.element.android-compose-library")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "io.element.android.x.libraries.testtags"
|
||||||
|
}
|
||||||
17
libraries/testtags/src/main/AndroidManifest.xml
Normal file
17
libraries/testtags/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright (c) 2023 New Vector Ltd
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<manifest />
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.element.android.x.libraries.testtags
|
||||||
|
|
||||||
|
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.semantics.semantics
|
||||||
|
import androidx.compose.ui.semantics.testTag
|
||||||
|
import androidx.compose.ui.semantics.testTagsAsResourceId
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a testTag to a Modifier, to be used by external tool, like TrafficLight for instance.
|
||||||
|
*/
|
||||||
|
@OptIn(ExperimentalComposeUiApi::class)
|
||||||
|
fun Modifier.testTag(id: TestTag) = this.then(
|
||||||
|
semantics {
|
||||||
|
testTag = id.value
|
||||||
|
testTagsAsResourceId = true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.element.android.x.libraries.testtags
|
||||||
|
|
||||||
|
@JvmInline
|
||||||
|
value class TestTag internal constructor(val value: String)
|
||||||
|
|
||||||
|
object TestTags {
|
||||||
|
/**
|
||||||
|
* OnBoarding screen.
|
||||||
|
*/
|
||||||
|
val onBoardingSignIn = TestTag("onboarding-sign_in")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Login screen.
|
||||||
|
*/
|
||||||
|
val loginChangeServer = TestTag("login-change_server")
|
||||||
|
val loginEmailUsername = TestTag("login-email_username")
|
||||||
|
val loginPassword = TestTag("login-password")
|
||||||
|
val loginContinue = TestTag("login-continue")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change server screen.
|
||||||
|
*/
|
||||||
|
val changeServerServer = TestTag("change_server-server")
|
||||||
|
val changeServerContinue = TestTag("change_server-continue")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -41,6 +41,7 @@ include(":libraries:matrixui")
|
||||||
include(":libraries:textcomposer")
|
include(":libraries:textcomposer")
|
||||||
include(":libraries:elementresources")
|
include(":libraries:elementresources")
|
||||||
include(":libraries:ui-strings")
|
include(":libraries:ui-strings")
|
||||||
|
include(":libraries:testtags")
|
||||||
include(":features:onboarding")
|
include(":features:onboarding")
|
||||||
include(":features:login")
|
include(":features:login")
|
||||||
include(":features:logout")
|
include(":features:logout")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue