1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.jsf;
17
18 import org.jboss.arquillian.core.api.annotation.Inject;
19 import org.jboss.arquillian.graphene.page.Page;
20 import org.jboss.hal.meta.token.NameTokens;
21 import org.jboss.hal.resources.Ids;
22 import org.jboss.hal.resources.Names;
23 import org.jboss.hal.testsuite.Console;
24 import org.jboss.hal.testsuite.CrudOperations;
25 import org.jboss.hal.testsuite.container.WildFlyContainer;
26 import org.jboss.hal.testsuite.fixtures.JSFFixtures;
27 import org.jboss.hal.testsuite.fragment.finder.FinderPath;
28 import org.jboss.hal.testsuite.page.configuration.JSFPage;
29 import org.jboss.hal.testsuite.test.Manatoko;
30 import org.junit.jupiter.api.BeforeAll;
31 import org.junit.jupiter.api.Test;
32 import org.testcontainers.junit.jupiter.Container;
33 import org.testcontainers.junit.jupiter.Testcontainers;
34 import org.wildfly.extras.creaper.core.online.operations.Operations;
35
36 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
37
38 @Manatoko
39 @Testcontainers
40 class JSFTest {
41
42 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
43 private static Operations operations;
44
45 @BeforeAll
46 static void setupModel() {
47 operations = new Operations(wildFly.managementClient());
48 }
49
50 @Inject Console console;
51 @Inject CrudOperations crudOperations;
52 @Page JSFPage page;
53
54 @Test
55 public void view() {
56 console.finder(NameTokens.CONFIGURATION, new FinderPath().append(Ids.CONFIGURATION, Ids.asId(Names.SUBSYSTEMS)))
57 .column(Ids.CONFIGURATION_SUBSYSTEM)
58 .selectItem(JSFFixtures.JSF)
59 .view();
60 console.verify(page.getPlaceRequest());
61 }
62
63 @Test
64 public void updateDefaultJSFImplSlot() throws Exception {
65 page.navigate();
66 crudOperations.update(JSFFixtures.JSF_ADDRESS, page.getDataForm(), JSFFixtures.DEFAULT_JSF_IMPL_SLOT);
67 }
68
69 @Test
70 public void toggleDisallowDoctypeDecl() throws Exception {
71 page.navigate();
72 boolean disallowDoctypeDecl = operations.readAttribute(JSFFixtures.JSF_ADDRESS, JSFFixtures.DISALLOW_DOCTYPE_DECL)
73 .booleanValue(false);
74 crudOperations.update(JSFFixtures.JSF_ADDRESS, page.getDataForm(), JSFFixtures.DISALLOW_DOCTYPE_DECL,
75 !disallowDoctypeDecl);
76 }
77 }