Skip to content

Commit

Permalink
Fix potential flakiness on cypress tests checklist 7
Browse files Browse the repository at this point in the history
1) Update app-react SiteEditScreen to use dispatchers.main.immediate
2) Use ustadTypeAndVerify when entering site terms
  • Loading branch information
mikedawson committed May 3, 2024
1 parent 92e9d81 commit be894e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Expand Up @@ -24,6 +24,7 @@ import mui.system.responsive
import react.FC
import react.Props
import react.ReactNode
import kotlinx.coroutines.Dispatchers

external interface SiteEditProps: Props {
var uiState: SiteEditUiState
Expand Down Expand Up @@ -114,7 +115,7 @@ val SiteEditScreen = FC<Props> {
val viewModel = useUstadViewModel { di, savedStateHandle ->
SiteEditViewModel(di, savedStateHandle)
}
val uiStateVal by viewModel.uiState.collectAsState(SiteEditUiState())
val uiStateVal by viewModel.uiState.collectAsState(SiteEditUiState(), Dispatchers.Main.immediate)

SiteEditComponent2 {
uiState = uiStateVal
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -85,7 +85,7 @@ allprojects {
}

//Major.minor.database version
version = "0.4.120"
version = "0.4.121"
group = "com.ustadmobile.app"

/**
Expand All @@ -95,7 +95,7 @@ group = "com.ustadmobile.app"
*/
ext {
ustadVersion = project.version
ustadVersionCode = 344
ustadVersionCode = 345


version_gradle_buildconfig_plugin = "1.1.7"
Expand Down
2 changes: 1 addition & 1 deletion test-end-to-end/webapp-cypress/cypress/support/commands.js
Expand Up @@ -340,7 +340,7 @@ Cypress.Commands.add('ustadEnableUserRegistration' ,() => {
//https://docs.cypress.io/api/commands/should#Assert-the-href-attribute-is-equal-to-users
cy.get('#terms_html_edit .ql-editor').as('editor')
cy.get('@editor').should('have.attr', 'contenteditable').and('equal', 'true',{timeout:3000})
cy.get('@editor').click().clear().type("New Terms",{delay:25})
cy.get('@editor').click().clear().ustadTypeAndVerify("New Terms")
cy.get('#registration_allowed').click({force:true})
cy.get('#actionBarButton').should('be.visible')
cy.get('#actionBarButton').click()
Expand Down

0 comments on commit be894e3

Please sign in to comment.