All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.codecentric.zucchini.web.pageobjects.SimplePage Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2014 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package de.codecentric.zucchini.web.pageobjects;

/**
 * A simple page is a page object that does not define additional operations.
 *
 * You can use a static method import as a shorthand:
 * 
 * given(onPage(url("http://www.example.com")))
 * .when(...)
 * .then(...)
 * .end();
 * 
 */
public class SimplePage extends AbstractPageObject {
	private final String url;

	/**
	 * Provides a shorthand that integrates well into the DSL.
	 *
	 * @param url The URL of the page object.
	 * @return A page object described by the given URL.
	 */
	public static SimplePage url(String url) {
		return new SimplePage(url);
	}

	/**
	 * Initializes a new page object that is described by a URL.
	 *
	 * @param url The URL of the page object.
	 */
	@SuppressWarnings("WeakerAccess")
    public SimplePage(String url) {
		this.url = url;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected String getUrl() {
		return url;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy