1 Star 1 Fork 0

周华健/pytest-selenium-shop-ui-test

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
shop-admin-ui-test.side 37.68 KB
Copy Edit Raw Blame History
zhouhuajian authored 2024-07-30 18:37 +08:00 . 06 自动测试订单设置
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952
{
"id": "552b1ea6-93d0-4342-9269-875667d35bdd",
"version": "2.0",
"name": "shop-admin-ui-test",
"url": "http://admin.shop.com/#/oms/order-setting",
"tests": [{
"id": "8ce1a134-a7f6-4979-b426-b24a0f9c3f65",
"name": "login-fail",
"commands": [{
"id": "3dd3e0b7-7b3b-4f22-9eb3-b387277b3677",
"comment": "",
"command": "open",
"target": "/",
"targets": [],
"value": ""
}, {
"id": "ae0f5b45-41dd-4963-8047-87c6f2b31ea7",
"comment": "",
"command": "type",
"target": "name=username",
"targets": [
["name=username", "name"],
["css=.el-form-item:nth-child(3) .el-input__inner", "css:finder"],
["xpath=//input[@name='username']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "admin"
}, {
"id": "376e7031-850c-4654-ae88-7d6c2bf62fbe",
"comment": "",
"command": "type",
"target": "name=password",
"targets": [
["name=password", "name"],
["css=.el-input--suffix > .el-input__inner", "css:finder"],
["xpath=//input[@name='password']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div/form/div[3]/div/div/input", "xpath:idRelative"],
["xpath=//div[3]/div/div/input", "xpath:position"]
],
"value": "123456"
}, {
"id": "83ecf41e-656f-4743-8b7c-b65afb58cf13",
"comment": "",
"command": "click",
"target": "css=.el-form-item__content > .el-button",
"targets": [
["css=.el-form-item__content > .el-button", "css:finder"],
["xpath=//button[@type='button']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div/form/div[4]/div/button", "xpath:idRelative"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'登录')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "687fc335-62bf-4777-8fd9-b19158cd7516",
"comment": "",
"command": "waitForText",
"target": "css=.el-message__content",
"targets": [
["css=.el-message__content", "css:finder"],
["xpath=//p", "xpath:position"],
["xpath=//p[contains(.,'用户名或密码错误')]", "xpath:innerText"]
],
"value": "用户名或密码错误"
}]
}, {
"id": "b36bbc58-f56b-4cbc-bf10-1582de801be4",
"name": "login-success",
"commands": [{
"id": "182f8882-7540-477f-9c0d-6a8cb7357e1a",
"comment": "",
"command": "open",
"target": "http://admin.shop.com/#/login",
"targets": [],
"value": ""
}, {
"id": "b51979da-5fbf-4338-8b0f-fa24c567b5e6",
"comment": "",
"command": "type",
"target": "name=username",
"targets": [
["name=username", "name"],
["css=.el-form-item:nth-child(3) .el-input__inner", "css:finder"],
["xpath=//input[@name='username']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "admin"
}, {
"id": "3b835bfc-788e-4dd9-b60a-c0f29439b70e",
"comment": "",
"command": "type",
"target": "name=password",
"targets": [
["name=password", "name"],
["css=.el-input--suffix > .el-input__inner", "css:finder"],
["xpath=//input[@name='password']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div/form/div[3]/div/div/input", "xpath:idRelative"],
["xpath=//div[3]/div/div/input", "xpath:position"]
],
"value": "admin"
}, {
"id": "63c24eee-fafa-4d76-a37b-c26712f95393",
"comment": "",
"command": "click",
"target": "css=.el-form-item__content > .el-button",
"targets": [
["css=.el-form-item__content > .el-button", "css:finder"],
["xpath=//button[@type='button']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div/form/div[4]/div/button", "xpath:idRelative"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'登录')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "f285d35e-4272-4d20-95bf-1ded23a4026a",
"comment": "",
"command": "waitForElementVisible",
"target": "css=.user-avatar",
"targets": [
["css=.user-avatar", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/ul/div[3]/div/img", "xpath:idRelative"],
["xpath=//div[3]/div/img", "xpath:position"]
],
"value": "20000"
}]
}, {
"id": "34b51628-f94a-4990-8f0c-f73fdd05f7ec",
"name": "show-stats",
"commands": []
}, {
"id": "05c00168-b249-4932-9701-b772e174f73c",
"name": "search-by-product-name",
"commands": [{
"id": "37d759f2-1997-4047-a7b3-c74a7c6f0b08",
"comment": "",
"command": "open",
"target": "http://admin.shop.com/#/pms/product",
"targets": [],
"value": ""
}, {
"id": "2ba6df39-eba8-498a-8f89-29463f122f91",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(1) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(1) .el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div/div[2]/form/div/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "TEST-测试电视"
}, {
"id": "01352817-f022-42d2-b3d5-48d182c311f7",
"comment": "",
"command": "click",
"target": "css=.el-button--primary:nth-child(3)",
"targets": [
["css=.el-button--primary:nth-child(3)", "css:finder"],
["xpath=//button[@type='button']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div/div/button", "xpath:idRelative"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'查询结果')]", "xpath:innerText"]
],
"value": ""
}]
}, {
"id": "0204d52f-3614-4c4a-aa7d-906a6e7eb915",
"name": "search-by-product-serial-number",
"commands": [{
"id": "13837eeb-eb50-4edf-b991-d9c8c977eaaf",
"comment": "",
"command": "open",
"target": "http://admin.shop.com/#/pms/product",
"targets": [],
"value": ""
}, {
"id": "a04f0e4c-f195-49b2-b379-b15ec79abe6c",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(2) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(2) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div/div[2]/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div/div/input", "xpath:position"]
],
"value": "TEST-1010101010"
}, {
"id": "dd48a18b-d029-4320-80ae-aee1008927a0",
"comment": "",
"command": "click",
"target": "css=.el-button--primary:nth-child(3) > span",
"targets": [
["css=.el-button--primary:nth-child(3) > span", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div/div/button/span", "xpath:idRelative"],
["xpath=//button/span", "xpath:position"],
["xpath=//span[contains(.,'查询结果')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "c1b076f3-90e2-4512-9ca2-b15bd08daa82",
"comment": "",
"command": "waitForText",
"target": "css=.el-pagination__total",
"targets": [
["css=.el-pagination__total", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[5]/div/span", "xpath:idRelative"],
["xpath=//div[5]/div/span", "xpath:position"],
["xpath=//span[contains(.,'共 1 条')]", "xpath:innerText"]
],
"value": "共 1 条"
}, {
"id": "d324009b-595d-4f69-8fa7-48ee85679fa9",
"comment": "",
"command": "waitForText",
"target": "css=.el-table_1_column_5 p:nth-child(2)",
"targets": [
["css=.el-table_1_column_5 p:nth-child(2)", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[5]/div/p[2]", "xpath:idRelative"],
["xpath=//td[5]/div/p[2]", "xpath:position"],
["xpath=//p[contains(.,'货号:TEST-1010101010')]", "xpath:innerText"]
],
"value": "货号:TEST-1010101010"
}]
}, {
"id": "840cb075-564f-44a5-9f40-f7aa7389d405",
"name": "add-product-simple",
"commands": [{
"id": "a72c9c49-eefe-4230-81ae-2e7529c588f2",
"comment": "",
"command": "open",
"target": "http://admin.shop.com/#/pms/add-product",
"targets": [],
"value": ""
}, {
"id": "b0c82d22-1e38-430a-8852-3a5ece25965e",
"comment": "",
"command": "click",
"target": "css=.el-cascader__label",
"targets": [
["css=.el-cascader__label", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div/div/span/span", "xpath:idRelative"],
["xpath=//div/div/span/span", "xpath:position"]
],
"value": ""
}, {
"id": "faa7b0c2-7889-4b8f-a62d-d5bd0b33912b",
"comment": "",
"command": "click",
"target": "css=.el-cascader-menu__item:nth-child(1)",
"targets": [
["css=.el-cascader-menu__item:nth-child(1)", "css:finder"],
["xpath=//ul[@id='cascader-menu-463']/li", "xpath:idRelative"],
["xpath=//div[2]/ul/li", "xpath:position"]
],
"value": ""
}, {
"id": "3bfd64b1-99d2-4384-8bf1-86f6042cf3a9",
"comment": "选择 冰箱",
"command": "click",
"target": "xpath=//li[contains(.,'冰箱')]",
"targets": [
["id=menu-9356-1-0", "id"],
["css=#menu-9356-1-0", "css:finder"],
["xpath=//li[@id='menu-9356-1-0']", "xpath:attributes"],
["xpath=//ul[@id='menu-9356-1']/li", "xpath:idRelative"],
["xpath=//ul[2]/li", "xpath:position"],
["xpath=//li[contains(.,'冰箱')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "25492fb0-98b6-45e0-8d2c-39811050b167",
"comment": "",
"command": "type",
"target": "css=.is-required:nth-child(2) .el-input__inner",
"targets": [
["css=.is-required:nth-child(2) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div/div/input", "xpath:position"]
],
"value": "111"
}, {
"id": "6544dbcf-b15d-4602-ab29-45b311119599",
"comment": "",
"command": "type",
"target": "css=.is-required:nth-child(3) .el-input__inner",
"targets": [
["css=.is-required:nth-child(3) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[3]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div[3]/div/div/input", "xpath:idRelative"],
["xpath=//div[3]/div/div/input", "xpath:position"]
],
"value": "222"
}, {
"id": "61fb3526-932e-4931-92e3-4d1c58a15cfc",
"comment": "",
"command": "click",
"target": "css=.is-required .el-select .el-input__inner",
"targets": [
["css=.is-required .el-select .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[4]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div[4]/div/div/div/input", "xpath:idRelative"],
["xpath=//div[4]/div/div/div/input", "xpath:position"]
],
"value": ""
}, {
"id": "d6ffb9d4-0fdc-4408-9d4d-180738332291",
"comment": "选择测试品牌9",
"command": "click",
"target": "xpath=//li[contains(.,'测试品牌9')]",
"targets": [
["css=.hover", "css:finder"],
["xpath=//div[3]/div/div/ul/li", "xpath:position"],
["xpath=//li[contains(.,'测试品牌9')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "b045b4bf-afda-49b8-bd5e-9bd7978ac283",
"comment": "",
"command": "click",
"target": "css=.el-form-item__content > .el-button--primary:nth-child(1) > span",
"targets": [
["css=.el-form-item__content > .el-button--primary:nth-child(1) > span", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div[13]/div/button/span", "xpath:idRelative"],
["xpath=//button/span", "xpath:position"],
["xpath=//span[contains(.,'下一步,填写商品促销')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "73c1be63-d2a1-4c2b-abf8-b75d0c4d4f9f",
"comment": "",
"command": "click",
"target": "css=.el-form-item:nth-child(17) .el-button--primary > span",
"targets": [
["css=.el-form-item:nth-child(17) .el-button--primary > span", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[3]/form/div[17]/div/button[2]/span", "xpath:idRelative"],
["xpath=//div[17]/div/button[2]/span", "xpath:position"],
["xpath=//span[contains(.,'下一步,填写商品属性')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "916344bf-903d-4289-942a-e00919fa4072",
"comment": "",
"command": "click",
"target": "css=.el-form-item:nth-child(6) .el-button--primary > span",
"targets": [
["css=.el-form-item:nth-child(6) .el-button--primary > span", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[4]/form/div[6]/div/button[2]/span", "xpath:idRelative"],
["xpath=//div[6]/div/button[2]/span", "xpath:position"],
["xpath=//span[contains(.,'下一步,选择商品关联')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "c6c5f340-8935-4475-88d4-24071411f1a2",
"comment": "",
"command": "click",
"target": "css=.el-form-item:nth-child(3) .el-button--primary",
"targets": [
["css=.el-form-item:nth-child(3) .el-button--primary", "css:finder"],
["xpath=(//button[@type='button'])[85]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[5]/form/div[3]/div/button[2]", "xpath:idRelative"],
["xpath=//div[3]/div/button[2]", "xpath:position"],
["xpath=//button[contains(.,'完成,提交商品')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "2e9db11f-14fd-40f0-a021-9741ffcb417a",
"comment": "点击 确定",
"command": "click",
"target": "css=.el-button--default:nth-child(2) > span",
"targets": [
["css=.el-button--default:nth-child(2) > span", "css:finder"],
["xpath=//div[3]/button[2]/span", "xpath:position"],
["xpath=//span[contains(.,'确定')]", "xpath:innerText"]
],
"value": ""
}]
}, {
"id": "2a0514d4-b0e2-4702-85ec-09aff8f6b8f5",
"name": "add-product-simple-part2",
"commands": [{
"id": "27ea578c-00ff-4813-8b7c-3154b3385a6e",
"comment": "",
"command": "open",
"target": "http://admin.shop.com/#/pms/product",
"targets": [],
"value": ""
}, {
"id": "5db2e184-6bf4-4bf3-b592-dcdab47279c8",
"comment": "",
"command": "waitForElementVisible",
"target": "css=.el-table__row:nth-child(1)",
"targets": [
["css=.el-table__row:nth-child(1) > .el-table_1_column_2", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[2]", "xpath:idRelative"],
["xpath=//td[2]", "xpath:position"],
["xpath=//td[contains(.,'78')]", "xpath:innerText"]
],
"value": "30000"
}, {
"id": "a8f53435-852d-4f0d-9860-69be1a4818e8",
"comment": "点击 编辑",
"command": "click",
"target": "css=.el-table__row:nth-child(1) .el-button--default:nth-child(2)",
"targets": [
["css=.el-table__row:nth-child(1) .el-button--default:nth-child(2)", "css:finder"],
["xpath=(//button[@type='button'])[7]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[11]/div/p/button[2]", "xpath:idRelative"],
["xpath=//p/button[2]", "xpath:position"],
["xpath=//button[contains(.,'编辑')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "08056b56-6bbc-4a11-a3fc-ac50bcc5a35d",
"comment": "",
"command": "waitForText",
"target": "css=.el-cascader__label",
"targets": [
["css=.el-cascader__label", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div/div/span/span", "xpath:idRelative"],
["xpath=//div/div/span/span", "xpath:position"]
],
"value": "家用电器 / 冰箱"
}, {
"id": "ec52c38f-0b75-4c8f-8c06-0f94336ca522",
"comment": "",
"command": "assertValue",
"target": "css=.is-required:nth-child(2) .el-input__inner",
"targets": [
["css=.is-required:nth-child(2) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div/div/input", "xpath:position"]
],
"value": "111"
}, {
"id": "f57ddad1-53fb-45d8-824e-ae925c854bfd",
"comment": "",
"command": "assertValue",
"target": "css=.is-required:nth-child(3) .el-input__inner",
"targets": [
["css=.is-required:nth-child(3) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[3]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div[3]/div/div/input", "xpath:idRelative"],
["xpath=//div[3]/div/div/input", "xpath:position"]
],
"value": "222"
}, {
"id": "c7db028d-cc6e-45ef-bbb2-b2db966d1709",
"comment": "",
"command": "assertValue",
"target": "css=.is-required .el-select .el-input__inner",
"targets": [
["css=.is-required .el-select .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[4]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/div[2]/form/div[4]/div/div/div/input", "xpath:idRelative"],
["xpath=//div[4]/div/div/div/input", "xpath:position"]
],
"value": "测试品牌9"
}]
}, {
"id": "6218eded-47bb-4c3c-9885-def3bc0585c4",
"name": "add-brand-then-delete",
"commands": [{
"id": "7a4c8c3a-a647-460b-9065-013e74543eae",
"comment": "",
"command": "open",
"target": "http://admin.shop.com/#/pms/brand",
"targets": [],
"value": ""
}, {
"id": "0275e4ab-9dcf-43f6-8f6f-e483954bb1a7",
"comment": "",
"command": "click",
"target": "css=.btn-add",
"targets": [
["css=.btn-add", "css:finder"],
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[2]/div/button", "xpath:idRelative"],
["xpath=//div[2]/div/button", "xpath:position"],
["xpath=//button[contains(.,'添加')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "f7af8987-7d73-424c-80eb-0345e301762b",
"comment": "",
"command": "type",
"target": "css=.is-required .el-input__inner",
"targets": [
["css=.is-required .el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "123456"
}, {
"id": "80260009-ba17-4a2d-968f-820baffea24f",
"comment": "",
"command": "type",
"target": "name=file",
"targets": [
["name=file", "name"],
["css=.is-required .el-upload__input", "css:finder"],
["xpath=//input[@name='file']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[3]/div/div/div/div/input", "xpath:idRelative"],
["xpath=//div/div/div/div/input", "xpath:position"]
],
"value": "C:\\Users\\zhouhuajian\\Downloads\\logo.png"
}, {
"id": "c999d32d-ace8-4547-ad37-42948365a660",
"comment": "",
"command": "click",
"target": "css=.el-form-item:nth-child(8) .el-radio:nth-child(1) .el-radio__inner",
"targets": [
["css=.el-form-item:nth-child(8) .el-radio:nth-child(1) .el-radio__inner", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[8]/div/div/label/span/span", "xpath:idRelative"],
["xpath=//div[8]/div/div/label/span/span", "xpath:position"]
],
"value": ""
}, {
"id": "ebab6456-cfc0-46d7-a7d8-f890006c3cfa",
"comment": "",
"command": "click",
"target": "css=.el-form-item__content > .el-button--primary",
"targets": [
["css=.el-form-item__content > .el-button--primary", "css:finder"],
["xpath=(//button[@type='button'])[5]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[9]/div/button", "xpath:idRelative"],
["xpath=//div[9]/div/button", "xpath:position"],
["xpath=//button[contains(.,'提交')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "0d7e2434-c662-46e1-a04b-b7417dba5b5f",
"comment": "点击确定",
"command": "click",
"target": "css=.el-button--small:nth-child(2)",
"targets": [
["css=.el-button--small:nth-child(2)", "css:finder"],
["xpath=(//button[@type='button'])[9]", "xpath:attributes"],
["xpath=//div[3]/button[2]", "xpath:position"],
["xpath=//button[contains(.,'确定')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "87ea9929-93a6-41b8-b3ac-6eff6f435bb9",
"comment": "访问品牌管理 然后重新加载",
"command": "open",
"target": "http://admin.shop.com/#/pms/brand",
"targets": [],
"value": ""
}, {
"id": "7afb2fcb-fb6d-4e39-82cd-80e4f930c2b8",
"comment": "",
"command": "waitForElementVisible",
"target": "css=.el-table__row:nth-child(1)",
"targets": [
["css=.el-table__row:nth-child(1) > .el-table_1_column_2", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[2]", "xpath:idRelative"],
["xpath=//td[2]", "xpath:position"],
["xpath=//td[contains(.,'94')]", "xpath:innerText"]
],
"value": "30000"
}, {
"id": "5a1c4123-bcb1-4ad5-a626-a223a87d6703",
"comment": "",
"command": "assertText",
"target": "css=.el-table__row:nth-child(1) > .el-table_1_column_3 > .cell",
"targets": [
["css=.el-table__row:nth-child(1) > .el-table_1_column_3 > .cell", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[3]/div", "xpath:idRelative"],
["xpath=//td[3]/div", "xpath:position"]
],
"value": "123456"
}, {
"id": "6ce60f99-230f-43eb-8fd2-287a804d73b1",
"comment": "",
"command": "assertChecked",
"target": "css=.el-table__row:nth-child(1) > .el-table_1_column_6 .el-switch__input",
"targets": [
["css=.el-table__row:nth-child(1) > .el-table_1_column_6 .el-switch__core", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[6]/div/div/span", "xpath:idRelative"],
["xpath=//td[6]/div/div/span", "xpath:position"]
],
"value": ""
}, {
"id": "f5dbe048-95d8-41c9-82f4-b12acf98a16a",
"comment": "",
"command": "assertNotChecked",
"target": "css=.el-table__row:nth-child(1) > .el-table_1_column_7 .el-switch__input",
"targets": [
["css=.el-table__row:nth-child(1) > .el-table_1_column_7 .el-switch__core", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[7]/div/div/span", "xpath:idRelative"],
["xpath=//td[7]/div/div/span", "xpath:position"]
],
"value": ""
}, {
"id": "31bfa6fe-8a7a-4b3e-857f-95f802ba0590",
"comment": "点击删除",
"command": "click",
"target": "css=.el-table__row:nth-child(1) .el-button--danger > span",
"targets": [
["css=.el-table__row:nth-child(1) .el-button--danger > span", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[9]/div/button[2]/span", "xpath:idRelative"],
["xpath=//td[9]/div/button[2]/span", "xpath:position"],
["xpath=//span[contains(.,'删除')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "39ebc665-ab32-408e-81db-75f3899a7bcc",
"comment": "",
"command": "click",
"target": "css=.el-button--default:nth-child(2) > span",
"targets": [
["css=.el-button--default:nth-child(2) > span", "css:finder"],
["xpath=//div[3]/button[2]/span", "xpath:position"]
],
"value": ""
}, {
"id": "c8d4ec83-dc6d-448c-b838-3df6f3c51f8c",
"comment": "",
"command": "waitForElementVisible",
"target": "css=.el-table__row:nth-child(1)",
"targets": [
["css=.el-table__row:nth-child(1) > .el-table_1_column_2", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[2]", "xpath:idRelative"],
["xpath=//td[2]", "xpath:position"],
["xpath=//td[contains(.,'94')]", "xpath:innerText"]
],
"value": "30000"
}, {
"id": "6ad999f7-f6e3-4c33-8601-c18d2f6370fd",
"comment": "",
"command": "assertNotText",
"target": "css=.el-table__row:nth-child(1) > .el-table_1_column_3 > .cell",
"targets": [
["css=.el-table__row:nth-child(1) > .el-table_1_column_3 > .cell", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div[3]/div/div[3]/table/tbody/tr/td[3]/div", "xpath:idRelative"],
["xpath=//td[3]/div", "xpath:position"]
],
"value": "123456"
}]
}, {
"id": "4f95283e-7e80-43ca-a1b9-d5b78468d868",
"name": "order-setting-form-validation",
"commands": [{
"id": "67db2c3b-9bf9-4b66-af4b-4fabf99b184f",
"comment": "",
"command": "open",
"target": "http://admin.shop.com/#/oms/order-setting",
"targets": [],
"value": ""
}, {
"id": "673af951-69e2-4b77-b2b7-57383c6e7790",
"comment": "1",
"command": "doubleClick",
"target": "css=.el-form-item:nth-child(1) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(1) .el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "f0b1d999-8337-4766-b0be-9414d5720c61",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(1) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(1) .el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "退格键"
}, {
"id": "7652886e-9a08-406d-9b1f-8770e8833022",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "4f33d53d-3a3a-47d0-9e8d-730905589096",
"comment": "2",
"command": "doubleClick",
"target": "css=.el-form-item:nth-child(2) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(2) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div/div/input", "xpath:position"]
],
"value": ""
}, {
"id": "009d8cc9-293f-406b-a6b9-e89f6f4ee644",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(2) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(2) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div/div/input", "xpath:position"]
],
"value": "aaa"
}, {
"id": "4ca33c2f-0270-4ef8-afe7-d2eed4345b59",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "85b31756-e6e5-4989-866e-a9eb046ea27c",
"comment": "3",
"command": "doubleClick",
"target": "css=.el-form-item:nth-child(3) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(3) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[3]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[3]/div/div/input", "xpath:idRelative"],
["xpath=//div[3]/div/div/input", "xpath:position"]
],
"value": ""
}, {
"id": "1247f97c-8a62-48d4-9704-17c0ad22688e",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(3) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(3) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[3]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[3]/div/div/input", "xpath:idRelative"],
["xpath=//div[3]/div/div/input", "xpath:position"]
],
"value": "15.1"
}, {
"id": "32d80708-eb05-4f36-a745-f01808072b3f",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "3e093b4b-1c6a-464f-b28c-0a49c28e338a",
"comment": "4",
"command": "doubleClick",
"target": "css=.el-form-item:nth-child(4) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(4) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[4]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[4]/div/div/input", "xpath:idRelative"],
["xpath=//div[4]/div/div/input", "xpath:position"]
],
"value": ""
}, {
"id": "34ed7db7-ffc6-4e92-89a6-f74f18ed28b3",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(4) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(4) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[4]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[4]/div/div/input", "xpath:idRelative"],
["xpath=//div[4]/div/div/input", "xpath:position"]
],
"value": "-7"
}, {
"id": "45ed451c-694e-42ad-9d75-69c88d0a030d",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "a04010c0-1e94-4c4f-919a-8b47767f3501",
"comment": "5",
"command": "doubleClick",
"target": "css=.el-form-item:nth-child(5) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(5) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[5]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[5]/div/div/input", "xpath:idRelative"],
["xpath=//div[5]/div/div/input", "xpath:position"]
],
"value": ""
}, {
"id": "f6669b48-7dfa-4675-96f2-c549490c06c9",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(5) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(5) .el-input__inner", "css:finder"],
["xpath=(//input[@type='text'])[5]", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[5]/div/div/input", "xpath:idRelative"],
["xpath=//div[5]/div/div/input", "xpath:position"]
],
"value": "0"
}, {
"id": "e5a2178d-0350-458f-9d84-f75434a9de39",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "fa0e4736-8551-4d43-8425-dbade98a21bc",
"comment": "",
"command": "waitForText",
"target": "css=.el-form-item:nth-child(1) .el-form-item__error",
"targets": [
["css=.el-form-item:nth-child(1) .el-form-item__error", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div/div/div[2]", "xpath:idRelative"],
["xpath=//form/div/div/div[2]", "xpath:position"]
],
"value": "请输入大于0的正整数"
}, {
"id": "528d310d-ff62-4ea7-a6e8-448e983d595c",
"comment": "",
"command": "waitForText",
"target": "css=.el-form-item:nth-child(2) .el-form-item__error",
"targets": [
["css=.el-form-item:nth-child(1) .el-form-item__error", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div/div/div[2]", "xpath:idRelative"],
["xpath=//form/div/div/div[2]", "xpath:position"]
],
"value": "请输入大于0的正整数"
}, {
"id": "98065e0b-afa0-4d9e-ac2d-e692fc478638",
"comment": "",
"command": "waitForText",
"target": "css=.el-form-item:nth-child(3) .el-form-item__error",
"targets": [
["css=.el-form-item:nth-child(1) .el-form-item__error", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div/div/div[2]", "xpath:idRelative"],
["xpath=//form/div/div/div[2]", "xpath:position"]
],
"value": "请输入大于0的正整数"
}, {
"id": "995dbe10-d4c5-4e3c-935a-b0269e91bf14",
"comment": "",
"command": "waitForText",
"target": "css=.el-form-item:nth-child(4) .el-form-item__error",
"targets": [
["css=.el-form-item:nth-child(1) .el-form-item__error", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div/div/div[2]", "xpath:idRelative"],
["xpath=//form/div/div/div[2]", "xpath:position"]
],
"value": "请输入大于0的正整数"
}, {
"id": "df1caca3-1653-4489-a0ce-7bbc21f570d7",
"comment": "",
"command": "waitForText",
"target": "css=.el-form-item:nth-child(5) .el-form-item__error",
"targets": [
["css=.el-form-item:nth-child(1) .el-form-item__error", "css:finder"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div/div/div[2]", "xpath:idRelative"],
["xpath=//form/div/div/div[2]", "xpath:position"]
],
"value": "请输入大于0的正整数"
}, {
"id": "c8dae412-590d-4988-b3ac-51f98eec9f9e",
"comment": "点击提交",
"command": "click",
"target": "css=.el-button",
"targets": [
["css=.el-button", "css:finder"],
["xpath=//button[@type='button']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div[2]/section/div/div/form/div[6]/div/button", "xpath:idRelative"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'提交')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "f4b0b98f-7227-48f8-a161-271f6d672778",
"comment": "",
"command": "waitForText",
"target": "css=.el-message__content",
"targets": [
["css=.el-message__content", "css:finder"],
["xpath=//p", "xpath:position"],
["xpath=//p[contains(.,'请填写正确后再提交')]", "xpath:innerText"]
],
"value": "请填写正确后再提交"
}]
}],
"suites": [{
"id": "4ecb58be-563e-4284-ab2e-21f45d0d573e",
"name": "login-page",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["8ce1a134-a7f6-4979-b426-b24a0f9c3f65", "b36bbc58-f56b-4cbc-bf10-1582de801be4"]
}, {
"id": "5465cc59-b438-4380-82d4-2c768bf03fc3",
"name": "home-page",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["34b51628-f94a-4990-8f0c-f73fdd05f7ec"]
}, {
"id": "c4bc4b8a-a559-4c96-ae3a-277f40b376bc",
"name": "pms-product-page",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["05c00168-b249-4932-9701-b772e174f73c", "0204d52f-3614-4c4a-aa7d-906a6e7eb915"]
}, {
"id": "16490881-015e-4762-b561-d8bec7993ea3",
"name": "pms-add-product-page",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["840cb075-564f-44a5-9f40-f7aa7389d405", "2a0514d4-b0e2-4702-85ec-09aff8f6b8f5"]
}, {
"id": "1d1cb7b7-a4e6-4ed8-b06c-4b5251edb693",
"name": "pms-brand-page",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["6218eded-47bb-4c3c-9885-def3bc0585c4"]
}, {
"id": "8cc96d9d-b086-492d-b32f-dfa6f5f50b55",
"name": "oms-order-setting-page",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["4f95283e-7e80-43ca-a1b9-d5b78468d868"]
}],
"urls": ["http://admin.shop.com/", "http://admin.shop.com/#/login", "http://admin.shop.com/#/pms/product", "http://admin.shop.com/#/pms/add-product", "http://admin.shop.com/#/pms/brand", "http://admin.shop.com/#/oms/order-setting"],
"plugins": []
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/zhouhuajian-course/pytest-selenium-shop-ui-test.git
git@gitee.com:zhouhuajian-course/pytest-selenium-shop-ui-test.git
zhouhuajian-course
pytest-selenium-shop-ui-test
pytest-selenium-shop-ui-test
main

Search