mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-02 13:00:18 -05:00
chore: move server e2e tests to system-tests (#16354)
Co-authored-by: Brian Mann <brian.mann86@gmail.com> Co-authored-by: Zach Bloomquist <git@chary.us> Co-authored-by: Zach Bloomquist <github@chary.us>
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
testing security clickjacking and framebusting
|
||||
|
||||
<script type="text/javascript" src="/static/obstructive_code.js"></script>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
function run () {
|
||||
const div = document.createElement('div')
|
||||
|
||||
div.innerText = `security triggered ${(new Error).stack.split('\n', 3)[2]}`
|
||||
document.body.appendChild(div)
|
||||
}
|
||||
|
||||
window.topFoo = "foo"
|
||||
window.parentFoo = "foo"
|
||||
|
||||
;(function() {
|
||||
const top = 'foo'
|
||||
const parent = 'foo'
|
||||
const self = 'foo'
|
||||
|
||||
// should stay local
|
||||
if (top !== self) run()
|
||||
if (parent !== self) run()
|
||||
if (self !== top) run()
|
||||
if (self !== parent) run()
|
||||
})()
|
||||
|
||||
// TODO: replace object pattern destructuring
|
||||
// ;(function() {
|
||||
// const { top, parent, location } = window
|
||||
|
||||
// if (location != top.location) run()
|
||||
// if (parent != top.parent) run()
|
||||
// if (top != globalThis.top) run()
|
||||
// })()
|
||||
|
||||
|
||||
if (top != self) run()
|
||||
if (top!=self) run()
|
||||
if (top.location != self.location) run()
|
||||
if (top.location != location) run()
|
||||
if (parent.frames.length > 0) run()
|
||||
if (window != top) run()
|
||||
if (window.top !== window.self) run()
|
||||
if (window.top!==window.self) run()
|
||||
if (window.self != window.top) run()
|
||||
if (window.top != window.self) run()
|
||||
if (window["top"] != window["parent"]) run()
|
||||
if (window['top'] != window['parent']) run()
|
||||
if (window["top"] != self['parent']) run()
|
||||
if (parent && parent != window) run()
|
||||
if (parent && parent != self) run()
|
||||
if (parent && window.topFoo != topFoo) run()
|
||||
if (parent && window.parentFoo != parentFoo) run()
|
||||
if (parent && window != parent) run()
|
||||
if (parent && self != parent) run()
|
||||
if (parent && parent.frames && parent.frames.length > 0) run()
|
||||
if ((self.parent && !(self.parent === self)) && (self.parent.frames.length != 0)) run()
|
||||
|
||||
const div = document.createElement('div')
|
||||
|
||||
div.innerText = 'html ran'
|
||||
document.body.appendChild(div)
|
||||
})()
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user