Commit 81dea709 authored by 马博's avatar 马博

test

parent 8947c897
package ui.service;
import base.DuibaBaseUi;
import http.service.Authorization;
import org.openqa.selenium.Cookie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.util.Map;
import static com.codeborne.selenide.Selenide.open;
/**
* Created by mabo on 2019/4/16
*/
@Service
public class CmsLoginPage {
@Autowired
Authorization authorization;
public void init(String account, DuibaBaseUi father) throws Exception {
father.open("http://hd.dlp.duibatest.com.cn");
father.switchChrome();
open("http://hd.dlp.duibatest.com.cn");
Map<String,String> map = authorization.hdLoginCommonNew(account);
for (String key:map.keySet()
) {
father.driver.manage().addCookie(new Cookie(key,map.get(key)));
}
open("http://hd.dlp.duibatest.com.cn/static/index?appId=22563#/creditShop/creditShopSub/creditShopRenovation/renovation");
father.clickByClass("el-dialog__headerbtn");
father.clickByClass("iconfont-handle handle-xiangxiazhankai");
father.sleep(2);
}
}
package ui.service;
import base.DuibaBaseUi;
import http.service.Authorization;
import org.openqa.selenium.Cookie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* Created by mabo on 2019/4/17
*/
@Service
public class DafuwengLogin {
@Autowired
Authorization authorization;
public void init(int uid,String url,DuibaBaseUi father){
father.switchChrome();
father.open(url);
Map<String,String> map = authorization.dafuwengLogin(uid);
for (String key:map.keySet()
) {
father.driver.manage().addCookie(new Cookie(key,map.get(key)));
}
father.open(url);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment