forked from juice-shop/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirectAccessSpec.js
76 lines (59 loc) · 2.69 KB
/
directAccessSpec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const config = require('config')
const utils = require('../../lib/utils')
let blueprint
for (const product of config.get('products')) {
if (product.fileForRetrieveBlueprintChallenge) {
blueprint = product.fileForRetrieveBlueprintChallenge
break
}
}
describe('/', () => {
describe('challenge "easterEgg2"', () => {
it('should be able to access "secret" url for easter egg', () => {
browser.driver.get(browser.baseUrl + '/the/devs/are/so/funny/they/hid/an/easter/egg/within/the/easter/egg')
})
protractor.expect.challengeSolved({ challenge: 'Easter Egg Tier 2' })
})
describe('challenge "premiumPaywall"', () => {
it('should be able to access "super secret" url for premium content', () => {
browser.driver.get(browser.baseUrl + '/this/page/is/hidden/behind/an/incredibly/high/paywall/that/could/only/be/unlocked/by/sending/1btc/to/us')
})
protractor.expect.challengeSolved({ challenge: 'Premium Paywall' })
})
describe('challenge "privacyPolicyProof"', () => {
it('should be able to access proof url for reading the privacy policy', () => {
browser.driver.get(browser.baseUrl + '/we/may/also/instruct/you/to/refuse/all/reasonably/necessary/responsibility')
})
protractor.expect.challengeSolved({ challenge: 'Privacy Policy Tier 2' })
})
describe('challenge "extraLanguage"', () => {
it('should be able to access the Klingon translation file', () => {
browser.driver.get(browser.baseUrl + '/assets/i18n/tlh_AA.json')
})
protractor.expect.challengeSolved({ challenge: 'Extra Language' })
})
describe('challenge "retrieveBlueprint"', () => {
it('should be able to access the blueprint file', () => {
browser.driver.get(browser.baseUrl + '/assets/public/images/products/' + blueprint)
})
protractor.expect.challengeSolved({ challenge: 'Retrieve Blueprint' })
})
describe('challenge "securityPolicy"', () => {
it('should be able to access the security.txt file', () => {
browser.driver.get(browser.baseUrl + '/.well-known/security.txt')
})
protractor.expect.challengeSolved({ challenge: 'Security Policy' })
})
describe('challenge "emailLeak"', () => {
it('should be able to request the callback on /rest/user/whoami', () => {
browser.driver.get(browser.baseUrl + '/rest/user/whoami?callback=func')
})
protractor.expect.challengeSolved({ challenge: 'Email Leak' })
})
describe('challenge "accessLogDisclosure"', () => {
it('should be able to access today\'s access log file', () => {
browser.driver.get(browser.baseUrl + '/support/logs/access.log.' + utils.toISO8601(new Date()))
})
protractor.expect.challengeSolved({ challenge: 'Access Log' })
})
})