1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.hal.testsuite.test.configuration.ee;
17
18 import org.jboss.arquillian.core.api.annotation.Inject;
19 import org.jboss.arquillian.graphene.page.Page;
20 import org.jboss.hal.resources.Ids;
21 import org.jboss.hal.testsuite.Console;
22 import org.jboss.hal.testsuite.CrudOperations;
23 import org.jboss.hal.testsuite.Random;
24 import org.jboss.hal.testsuite.container.WildFlyContainer;
25 import org.jboss.hal.testsuite.fragment.FormFragment;
26 import org.jboss.hal.testsuite.page.configuration.EEPage;
27 import org.jboss.hal.testsuite.test.Manatoko;
28 import org.junit.jupiter.api.BeforeEach;
29 import org.junit.jupiter.api.Test;
30 import org.testcontainers.junit.jupiter.Container;
31 import org.testcontainers.junit.jupiter.Testcontainers;
32
33 import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
34 import static org.jboss.hal.dmr.ModelDescriptionConstants.PATH;
35 import static org.jboss.hal.dmr.ModelDescriptionConstants.RELATIVE_TO;
36 import static org.jboss.hal.testsuite.container.WildFlyConfiguration.DEFAULT;
37 import static org.jboss.hal.testsuite.fixtures.EEFixtures.GLOBAL_DIRECTORY_CREATE;
38 import static org.jboss.hal.testsuite.fixtures.EEFixtures.globalDirectoryAddress;
39 import static org.jboss.hal.testsuite.fixtures.PathsFixtures.JBOSS_SERVER_DATA_DIR;
40
41 @Manatoko
42 @Testcontainers
43 class GlobalDirectoryAddTest {
44
45 @Container static WildFlyContainer wildFly = WildFlyContainer.standalone(DEFAULT);
46
47 @Inject Console console;
48 @Inject CrudOperations crud;
49 @Page EEPage page;
50 FormFragment form;
51
52 @BeforeEach
53 void prepare() {
54 page.navigate();
55 console.verticalNavigation().selectPrimary(Ids.EE_GLOBAL_MODULES_ITEM);
56 form = page.getGlobalDirectoryForm();
57 }
58
59 @Test
60 void addGlobalDirectory() throws Exception {
61 crud.createSingleton(globalDirectoryAddress(GLOBAL_DIRECTORY_CREATE), form, f -> {
62 f.text(NAME, GLOBAL_DIRECTORY_CREATE);
63 f.text(PATH, Random.name());
64 f.text(RELATIVE_TO, JBOSS_SERVER_DATA_DIR);
65 });
66 }
67 }