Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 055ea8d

Browse files
author
Samuel Nitsche
committed
Adjusted download script to use some cookie logic
1 parent fc6a925 commit 055ea8d

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

.travis/download.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,19 @@ var agreementUrl = casper.cli.get(2);
1919
var downloadUrl = casper.cli.get(3);
2020
var downloaded = false;
2121

22+
phantom.addCookie({
23+
'name': 'oraclelicense',
24+
'value': '152021',
25+
'domain': 'oracle.com'
26+
});
27+
2228
casper.start();
2329
// TODO: Error handling.
2430

25-
// Accept the license agreement.
26-
casper.thenOpen(agreementUrl, function () {
27-
// this.echo("Accepting License");
28-
this.evaluate(function () {
29-
acceptAgreement(window.self);
30-
});
31-
});
3231

3332
// Try to access the download page, wait for redirection and submit the login form.
3433
casper.thenOpen(downloadUrl).waitForUrl(/signon\.jsp$/, function (re) {
35-
// this.echo("Injecting Login Info");
34+
//this.echo("Injecting Login Info");
3635
this.evaluate(function (username, password) {
3736
document.getElementById("sso_username").value = username;
3837
document.getElementById("ssopassword").value = password;
@@ -42,8 +41,9 @@ casper.thenOpen(downloadUrl).waitForUrl(/signon\.jsp$/, function (re) {
4241
});
4342

4443
casper.on("resource.received", function (resource) {
44+
//this.echo("Received something: " + resource.url);
4545
if (resource.url.indexOf("AuthParam") !== -1 && !downloaded) {
46-
// this.echo("DownloadUrl:");
46+
//this.echo("DownloadUrl:");
4747
// Print the download url.
4848
this.echo(resource.url);
4949
downloaded = true;

.travis/download.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ fi
6262
if [ "$PRODUCT" == "sqlcl" ]; then
6363
agreementUrl="http://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/index.html"
6464
downloadUrl="https://download.oracle.com/otn/java/sqldeveloper/sqlcl-18.3.0.259.2029.zip"
65+
#downloadUrl="https://download.oracle.com/otn/java/sqldeveloper/sqlcl-19.2.1.206.1649.zip"
6566
outputFile=sqlcl-18.3.0.259.2029.zip
6667
downloadFile $agreementUrl $downloadUrl $outputFile
6768
exit 0

0 commit comments

Comments
 (0)