-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdevgetchanges.py
63 lines (55 loc) · 2.87 KB
/
devgetchanges.py
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
import os
import shutil
# Change directory to the user's home directory
os.chdir(os.path.expanduser("~"))
# Define paths
src_base = os.path.join("Documents", "workspace", "microting", "eform-angular-frontend")
dst_base = os.path.join("Documents", "workspace", "microting", "eform-angular-items-planning-plugin")
# List of test files and directories to remove
test_files_to_remove = [
os.path.join("eform-client", "e2e", "Tests", "items-planning-settings"),
os.path.join("eform-client", "e2e", "Tests", "items-planning-general"),
os.path.join("eform-client", "wdio-plugin-step2.conf.ts"),
os.path.join("eform-client", "e2e", "Page objects", "ItemsPlanning"),
os.path.join("eform-client", "e2e", "Assets"),
os.path.join("eform-client", "cypress", "e2e", "plugins", "items-planning-pn"),
]
# Remove the test files and directories
for rel_path in test_files_to_remove:
full_path = os.path.join(dst_base, rel_path)
if os.path.exists(full_path):
if os.path.isdir(full_path):
shutil.rmtree(full_path)
else:
os.remove(full_path)
# Ensure the plugins directory exists within the Cypress structure
cypress_plugins_dir = os.path.join(dst_base, "eform-client", "cypress", "e2e", "plugins")
os.makedirs(cypress_plugins_dir, exist_ok=True)
# List of test files and directories to copy
test_files_to_copy = [
(os.path.join("eform-client", "e2e", "Tests", "items-planning-settings"),
os.path.join("eform-client", "e2e", "Tests", "items-planning-settings")),
(os.path.join("eform-client", "e2e", "Tests", "items-planning-general"),
os.path.join("eform-client", "e2e", "Tests", "items-planning-general")),
(os.path.join("eform-client", "e2e", "Page objects", "ItemsPlanning"),
os.path.join("eform-client", "e2e", "Page objects", "ItemsPlanning")),
(os.path.join("eform-client", "e2e", "Assets"),
os.path.join("eform-client", "e2e", "Assets")),
(os.path.join("eform-client", "wdio-headless-plugin-step2a.conf.ts"),
os.path.join("eform-client", "wdio-headless-plugin-step2a.conf.ts")),
(os.path.join("eform-client", "wdio-headless-plugin-step2b.conf.ts"),
os.path.join("eform-client", "wdio-headless-plugin-step2b.conf.ts")),
(os.path.join("eform-client", "wdio-headless-plugin-step2c.conf.ts"),
os.path.join("eform-client", "wdio-headless-plugin-step2c.conf.ts")),
(os.path.join("eform-client", "cypress", "e2e", "plugins", "items-planning-pn"),
os.path.join("eform-client", "cypress", "e2e", "plugins", "items-planning-pn")),
]
# Copy the test files and directories
for src_rel_path, dst_rel_path in test_files_to_copy:
src_path = os.path.join(src_base, src_rel_path)
dst_path = os.path.join(dst_base, dst_rel_path)
# Copy the source directory to the destination
if os.path.isdir(src_path):
shutil.copytree(src_path, dst_path)
else:
shutil.copy2(src_path, dst_path)