-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_repro.py
More file actions
55 lines (51 loc) · 1.61 KB
/
create_repro.py
File metadata and controls
55 lines (51 loc) · 1.61 KB
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
import os
def create_repro_files():
os.makedirs("repro_data", exist_ok=True)
# File 1: Red background, ID="content" says "File 1"
with open("repro_data/file1.html", "w") as f:
f.write("""
<html>
<head>
<style>
body { background-color: #ffcccc; }
#content { color: red; font-weight: bold; }
</style>
<script>
var uniqueData = "File 1 Data";
console.log("Loaded " + uniqueData);
</script>
</head>
<body>
<h1>Report 1</h1>
<div id="content">This is content from File 1.</div>
<script>
document.getElementById("content").innerText += " (JS Modified)";
</script>
</body>
</html>
""")
# File 2: Blue background, ID="content" says "File 2"
with open("repro_data/file2.html", "w") as f:
f.write("""
<html>
<head>
<style>
body { background-color: #ccccff; }
#content { color: blue; font-style: italic; }
</style>
<script>
var uniqueData = "File 2 Data";
console.log("Loaded " + uniqueData);
</script>
</head>
<body>
<h1>Report 2</h1>
<div id="content">This is content from File 2.</div>
<script>
document.getElementById("content").innerText += " (JS Modified)";
</script>
</body>
</html>
""")
if __name__ == "__main__":
create_repro_files()