av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

自動化測試框架PhoenixAutotest入門

PhoenixAutoTest是一個基于 Selenium 的Web自動測試框架,通過該框架可以簡化測試人員的學習難度,只要 編寫少量的Java代碼即可,大多數(shù)的工作都是編寫頁面元素的描述文件以及對應(yīng)的數(shù)據(jù)源。

成都創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供普陀網(wǎng)站建設(shè)、普陀做網(wǎng)站、普陀網(wǎng)站設(shè)計、普陀網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、普陀企業(yè)網(wǎng)站模板建站服務(wù),十載普陀做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。

介紹

WebUI自動化測試框架phoenix.webui.framework發(fā)布20170610版本。

本次發(fā)布修正了一些bug,更多Isseus信息請訪問Github。添加的主要功能如下:

增加了通過注解的方式來配置PageObject(頁面對象),單元測試代碼如下(本文所有的代碼都可以在Github項目中獲?。?/p>

/*
*
*  * Copyright 2002-2007 the original author or authors.
*  *
*  * Licensed under the Apache License, Version 2.0 (the "License");
*  * you may not use this file except in compliance with the License.
*  * You may obtain a copy of the License at
*  *
*  *      http://www.apache.org/licenses/LICENSE-2.0
*  *
*  * Unless required by applicable law or agreed to in writing, software
*  * distributed under the License is distributed on an "AS IS" BASIS,
*  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  * See the License for the specific language governing permissions and
*  * limitations under the License.
*
*/

package org.suren.autotest.web.framework.page;

import org.suren.autotest.web.framework.annotation.AutoDataSource;
import org.suren.autotest.web.framework.annotation.AutoLocator;
import org.suren.autotest.web.framework.annotation.AutoPage;
import org.suren.autotest.web.framework.annotation.AutoStrategy;
import org.suren.autotest.web.framework.core.LocatorType;
import org.suren.autotest.web.framework.core.StrategyType;
import org.suren.autotest.web.framework.core.ui.Button;
import org.suren.autotest.web.framework.core.ui.Text;

/**
* 使用注解的示例Page類
* @author suren
* @date 2017年6月7日 下午7:10:40
*/
@AutoPage(url = "http://maimai.cn/")
@AutoDataSource(name = "data", resource = "dataSource/xml/user_data_anno.xml")
public class AnnotationPage extends Page
{
@AutoStrategy(type = StrategyType.PRIORITY)
@AutoLocator(locator = LocatorType.BY_PARTIAL_LINK_TEXT, value = "實名動態(tài)")
private Button toLoginBut;

@AutoLocator(locator = LocatorType.BY_XPATH, value = "http://input[@placeholder='請輸入手機號碼/脈脈號']")
private Text phoneText;

public Button getToLoginBut() {
 return toLoginBut;
}

public void setToLoginBut(Button toLoginBut) {
 this.toLoginBut = toLoginBut;
}

public Text getPhoneText() {
 return phoneText;
}

public void setPhoneText(Text phoneText) {
 this.phoneText = phoneText;
}
}

測試代碼如下:

/*
*
*  * Copyright 2002-2007 the original author or authors.
*  *
*  * Licensed under the Apache License, Version 2.0 (the "License");
*  * you may not use this file except in compliance with the License.
*  * You may obtain a copy of the License at
*  *
*  *      http://www.apache.org/licenses/LICENSE-2.0
*  *
*  * Unless required by applicable law or agreed to in writing, software
*  * distributed under the License is distributed on an "AS IS" BASIS,
*  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  * See the License for the specific language governing permissions and
*  * limitations under the License.
*
*/

package org.suren.autotest.web.framework.util;

import org.junit.*;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.suren.autotest.web.framework.IgnoreReasonConstants;
import org.suren.autotest.web.framework.page.AnnotationPage;
import org.suren.autotest.web.framework.settings.DriverConstants;
import org.suren.autotest.web.framework.settings.SettingUtil;

import java.io.IOException;

/**
* 測試使用注解配置的方式
* @author suren
* @date 2017年6月7日 下午7:10:12
*/
@Configuration
@ComponentScan(basePackages = "org.suren.autotest.web.webframework.page")
public class AutoAnnotationTest
{
private SettingUtil util;

@Before
public void setUp()
{
 util = new SettingUtil();
}

@Test
public void basicTest()
{
 util.getEngine().setDriverStr(DriverConstants.DRIVER_HTML_UNIT);
 util.getEngine().init();

 AnnotationPage page = util.getPage(AnnotationPage.class);
 
 Assert.assertNotNull(page);
 Assert.assertNotNull(page.getUrl());

 Assert.assertNotNull(page.getToLoginBut());

 page.open();
 page.getToLoginBut().click();
}

@Test
@Ignore(value = IgnoreReasonConstants.REAL_BROWSER)
public void realTest()
{
 util.getEngine().setDriverStr(DriverConstants.DRIVER_CHROME);
 util.getEngine().init();
 util.initData();

 AnnotationPage page = util.getPage(AnnotationPage.class);
 page.open();
 page.getToLoginBut().click();

 page.getPhoneText().fillNotBlankValue();

 ThreadUtil.silentSleep(3000);
}

@After
public void tearDown() throws IOException
{
 util.close();
}
}

相關(guān)鏈接

PhoenixAutotest 的詳細介紹:點擊查看

PhoenixAutotest 的下載地址:點擊下載


網(wǎng)頁標題:自動化測試框架PhoenixAutotest入門
文章源于:http://uogjgqi.cn/article/dheheog.html
掃二維碼與項目經(jīng)理溝通

我們在微信上24小時期待你的聲音

解答本文疑問/技術(shù)咨詢/運營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流