View Javadoc
1   /*
2    * #%L
3    * wcm.io
4    * %%
5    * Copyright (C) 2017 wcm.io
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  package io.wcm.qa.glnm.selectors.base;
21  
22  import org.openqa.selenium.By;
23  
24  import com.galenframework.specs.page.Locator;
25  
26  /**
27   * Interface to represent selectors in Galenium. Selectors are used to identify elements in a page. This interface is
28   * used throughout Galenium up to the final hand off to Galen (as {@link com.galenframework.specs.page.Locator}) or Selenium (as {@link org.openqa.selenium.By}).
29   *
30   * @since 1.0.0
31   */
32  public interface Selector {
33  
34    /**
35     * <p>asBy.</p>
36     *
37     * @return Selenium By object representing this selector
38     */
39    By asBy();
40  
41    /**
42     * <p>asLocator.</p>
43     *
44     * @return Galen Locator representing this selector
45     */
46    Locator asLocator();
47  
48    /**
49     * <p>asString.</p>
50     *
51     * @return String representing a CSS selector
52     */
53    String asString();
54  
55    /**
56     * <p>elementName.</p>
57     *
58     * @return string representation that can be used as object name in Galen
59     */
60    String elementName();
61  }