|
1 | | -import yaml |
| 1 | +import yaml,os |
2 | 2 | from selenium import webdriver |
| 3 | +path=os.getcwd() |
3 | 4 | class Login_tes:#登录模块封装 |
4 | 5 | def __init__(self,driver):# |
5 | 6 | self.driber=driver |
6 | | - self.file=open(r"C:\Users\Administrator\Desktop\te_blogf\data\page_data.yaml", "r",encoding= "utf-8") |
| 7 | + self.file=open(path+"\\page\\page_data.yaml", "r",encoding= "utf-8") |
7 | 8 | self.data=yaml.load(self.file) |
8 | 9 | self.file.close() |
9 | 10 | self.lo_url=self.data['login'].get('url') |
@@ -34,7 +35,7 @@ def login(self,suc,name,password): |
34 | 35 | class Zhuce_tes:#注册模块的封装 |
35 | 36 | def __init__(self,driver): |
36 | 37 | self.deriver=driver |
37 | | - self.file1=open(r"C:\Users\Administrator\Desktop\te_blogf\data\page_data.yaml", "r",encoding= "utf-8") |
| 38 | + self.file1=open(path+"\\data\\page_data.yaml", "r",encoding= "utf-8") |
38 | 39 | self.data=yaml.load(self.file1) |
39 | 40 | self.file1.close() |
40 | 41 | self.zhu_url=self.data['zhuce'].get('url') |
@@ -75,7 +76,7 @@ def zhuce(self,suc,name,password,password1,shouji,email): |
75 | 76 | class Zaohui_tes: |
76 | 77 | def __init__(self,driver): |
77 | 78 | self.driver=driver |
78 | | - self.file1=open(r"C:\Users\Administrator\Desktop\te_blogf\data\page_data.yaml", "r",encoding= "utf-8") |
| 79 | + self.file1=open(path+"\\data\\page_data.yaml", "r",encoding= "utf-8") |
79 | 80 | self.data=yaml.load(self.file1) |
80 | 81 | self.file1.close() |
81 | 82 | self.zhao_url=self.data['zhaohui'].get('url') |
@@ -105,7 +106,7 @@ def zhaohui(self,suc,name,eamil): |
105 | 106 | class Rest_tes: |
106 | 107 | def __init__(self,driver): |
107 | 108 | self.driver=driver |
108 | | - self.file1=open(r"C:\Users\Administrator\Desktop\te_blogf\data\page_data.yaml", "r",encoding= "utf-8") |
| 109 | + self.file1=open(path+"\\data\\page_data.yaml", "r",encoding= "utf-8") |
109 | 110 | self.data=yaml.load(self.file1) |
110 | 111 | self.file1.close() |
111 | 112 | self.rest_url=self.data['reset_pwd'].get('url') |
@@ -141,7 +142,7 @@ def rest(self,suc,yan,eamil,mima,chongzhimima): |
141 | 142 | class Xiugai_tes: |
142 | 143 | def __init__(self,driver): |
143 | 144 | self.driver=driver |
144 | | - self.file1=open(r"C:\Users\Administrator\Desktop\te_blogf\data\page_data.yaml", "r",encoding= "utf-8") |
| 145 | + self.file1=open(path+"\\data\\page_data.yaml", "r",encoding= "utf-8") |
145 | 146 | self.data=yaml.load(self.file1) |
146 | 147 | self.file1.close() |
147 | 148 | self.xiugai_url=self.data['xiugai'].get('url') |
@@ -174,7 +175,7 @@ def xiugai(self,suc,yuanmima,mima,querenmima): |
174 | 175 | class Xiebo_tes: |
175 | 176 | def __init__(self,driver): |
176 | 177 | self.driver=driver |
177 | | - self.file1=open(r"C:\Users\Administrator\Desktop\te_blogf\data\page_data.yaml", "r",encoding= "utf-8") |
| 178 | + self.file1=open(path+"\\data\\page_data.yaml", "r",encoding= "utf-8") |
178 | 179 | self.data=yaml.load(self.file1) |
179 | 180 | self.file1.close() |
180 | 181 | self.xiebo_url=self.data['xiebo'].get('url') |
|
0 commit comments