org.gradle.docs.releasenotes.FunctionalReleaseNotesTest.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-api Show documentation
Show all versions of gradle-api Show documentation
Gradle 6.9.1 API redistribution.
/*
* Copyright 2012 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 org.gradle.docs.releasenotes
import geb.Browser
import geb.Configuration
import geb.spock.GebReportingSpec
import groovy.json.JsonSlurper
import org.gradle.util.GradleVersion
import org.openqa.selenium.htmlunit.HtmlUnitDriver
import spock.lang.Ignore
import spock.lang.IgnoreIf
import spock.lang.Shared
/**
* These tests actually open the release notes in a browser and test the JS.
*/
@Ignore
// @IgnoreIf({ !FunctionalReleaseNotesTest.canReachServices() })
class FunctionalReleaseNotesTest extends GebReportingSpec {
static private final String FIXED_ISSUES_URL = "https://services.gradle.org/fixed-issues/${GradleVersion.current().baseVersion.version}"
static private final String KNOWN_ISSUES_URL = "https://services.gradle.org/known-issues/${GradleVersion.current().baseVersion.version}"
private String version = GradleVersion.current().baseVersion.version
static boolean canReachServices() {
try {
HttpURLConnection connection = FIXED_ISSUES_URL.toURL().openConnection() as HttpURLConnection
connection.requestMethod = "HEAD"
connection.connect()
connection.responseCode == 200
} catch (IOException ignore) {
false
}
}
@Shared url = new ReleaseNotesTestContext().renderedFile.toURL().toString()
def setup() {
to ReleaseNotesPage
}
ReleaseNotesPage getPage() {
browser.page as ReleaseNotesPage
}
@Override
Browser createBrowser() {
new Browser(driver: new HtmlUnitDriver(true), new Configuration(reportsDir: new File("build/geb-reports")))
}
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy