Add Retry

This commit is contained in:
Alfredo Boullosa 2021-03-10 11:33:19 +01:00 committed by Pavel Drozd
parent fca65ac644
commit e126969f82

View file

@ -16,11 +16,12 @@
*/
package org.keycloak.testsuite.console.authorization;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
import org.junit.Test;
import org.keycloak.common.util.Retry;
/**
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
@ -34,11 +35,14 @@ public class DisableAuthorizationSettingsTest extends AbstractAuthorizationSetti
clientSettingsPage.navigateTo();
clientSettingsPage.form().setAuthorizationSettingsEnabled(false);
waitUntilElement(modalDialog.getMessage()).text().contains(WARNING_MESSAGE);
clientSettingsPage.form().confirmDisableAuthorizationSettings();
Thread.sleep(1000);
clientSettingsPage.form().save();
Retry.execute(() -> {
clientSettingsPage.form().save();
}, 10, 300);
clientSettingsPage.form().confirmDisableAuthorizationSettings();
assertAlertSuccess();
Retry.execute(this::assertAlertSuccess, 10, 300);
clientSettingsPage.navigateTo();
assertFalse(clientSettingsPage.form().isAuthorizationSettingsEnabled());