View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.libraries.htmx;
16  
17  import org.htmlunit.WebClient;
18  import org.htmlunit.javascript.preprocessor.HtmxTwoZeroSevenScriptPreProcessor;
19  import org.htmlunit.junit.annotation.Alerts;
20  import org.htmlunit.junit.annotation.HtmlUnitNYI;
21  import org.junit.jupiter.api.Test;
22  
23  /**
24   * Tests for <a href="https://htmx.org/">htmx</a>.
25   *
26   * @author Ronald Brill
27   */
28  public class HtmxTest2x0x5 extends HtmxTest {
29  
30      /**
31       * @throws Exception if an error occurs
32       */
33      @Test
34      @Alerts(DEFAULT = "passes:725failures:1",
35              FF = "passes:720failures:2",
36              FF_ESR = "passes:720failures:2")
37      @HtmlUnitNYI(
38              CHROME = "passes:697failures:18",
39              EDGE = "passes:697failures:18",
40              FF = "passes:710failures:14",
41              FF_ESR = "passes:710failures:14")
42      public void htmx() throws Exception {
43          htmx("htmx-2.0.5", false);
44      }
45  
46  //    /**
47  //     * @throws Exception if an error occurs
48  //     */
49  //    @Test
50  //    @Alerts(DEFAULT = "passes:552failures:68",
51  //            FF = "passes:552failures:67",
52  //            FF_ESR = "passes:552failures:67")
53  //    @HtmlUnitNYI(
54  //            CHROME = "passes:547failures:72",
55  //            EDGE = "passes:547failures:72",
56  //            FF = "passes:547failures:72",
57  //            FF_ESR = "passes:547failures:72")
58  //    public void htmxMin() throws Exception {
59  //        htmx("htmx-2.0.5", true);
60  //    }
61  
62      @Override
63      protected void setupWebClient(final WebClient webClient) {
64          super.setupWebClient(webClient);
65  
66          webClient.setScriptPreProcessor(new HtmxTwoZeroSevenScriptPreProcessor());
67          webClient.getOptions().setThrowExceptionOnScriptError(false);
68      }
69  }