ebay key, new project lukan

This commit is contained in:
Lukáš Kaňka 2023-10-16 20:57:54 +02:00
parent 2d5d21c8e2
commit 5b2c518d9f
13 changed files with 153 additions and 34 deletions

3
RobotSelenium/Lukan/.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (Lukan) (2)" project-jdk-type="Python SDK" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Lukan.iml" filepath="$PROJECT_DIR$/.idea/Lukan.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,15 @@
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${browser} chrome
${url} https://www.ebay.com/
*** Keywords ***
Start test
open browser ${url} ${browser}
maximize browser window
Finnish TestCase
close browser

View File

@ -0,0 +1,20 @@
*** Settings ***
Library SeleniumLibrary
*** Keywords ***
Verify Search Results
input text //*[@id="gh-ac"] mobile
# kliknout na tlačítko můžeme více způsoby
#click button xpath://*[@id="gh-btn"]
press keys xpath://*[@id="gh-btn"] RETURN
page should contain výsledků mobile
Filter results by condition
click element //span[contains(text(),"Stav")]
sleep 3s
CLICK ELEMENT //span[normalize-space()="Nový"]
Verify filter results
# ověřit filtr že zobrazí Nový
# opravit
ELEMENT SHOULD CONTAIN //*[@id="s0-53-17-6-3-4[0]-3-2-1-list"]/li/div/a/div/text()

View File

@ -1806,25 +1806,25 @@ function stopPropagation(event) {
window.output = {}; window.output = {};
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["suite"] = [1,2,3,4,[],[1,0,80665],[],[[5,0,6,[7],[1,473,80190],[[0,8,0,0,0,0,0,0,[1,475,55228],[[0,9,10,0,11,12,0,0,[1,475,55075],[[476,2,13]]],[0,14,10,0,15,0,0,0,[1,55550,153],[]]]],[0,16,0,0,0,0,0,0,[1,55704,22450],[[0,17,10,0,18,19,0,0,[1,55705,292],[[55707,2,20]]],[0,21,10,0,22,23,0,0,[1,55997,22089],[[55999,2,24],[78068,2,25],[78068,2,26]]],[0,27,10,0,28,29,0,0,[1,78087,66],[[78153,2,30]]]]],[0,31,0,0,0,0,0,0,[1,78154,2509],[[0,32,10,0,33,0,0,0,[1,78155,2507],[]]]]]]],[],[1,1,0,0]]; window.output["suite"] = [1,2,3,4,[],[1,0,14700],[],[[5,0,6,[7],[1,208,14491],[[1,8,9,0,0,0,0,0,[1,208,3871],[[0,10,11,0,12,13,0,0,[1,209,3743],[[209,2,14]]],[0,15,11,0,16,0,0,0,[1,3952,127],[]]]],[0,17,18,0,0,0,0,0,[1,4080,3417],[[0,19,11,0,20,21,0,0,[1,4080,115],[[4081,2,22]]],[0,23,11,0,24,25,0,0,[1,4195,3269],[[4195,2,26],[7324,2,27],[7324,2,28]]],[0,29,11,0,30,31,0,0,[1,7464,33],[[7497,2,32]]]]],[0,33,18,0,0,0,0,0,[1,7498,4903],[[0,34,11,0,35,36,0,0,[1,7498,45],[[7498,2,37]]],[0,38,39,0,40,41,0,0,[1,7543,3000],[[10543,2,42]]],[0,34,11,0,35,43,0,0,[1,10543,1858],[[10543,2,44]]]]],[2,45,9,0,0,0,0,0,[1,12401,2296],[[0,46,11,0,47,0,0,0,[1,12402,2295],[]]]]]]],[],[1,1,0,0]];
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["strings"] = []; window.output["strings"] = [];
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["strings"] = window.output["strings"].concat(["*","*BasicSearch","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Tests\\eBay\\BasicSearch.robot","*../Tests/eBay/BasicSearch.robot","*<p>Basic Search Funcianality\x3c/p>","*Verify basic search functionality foe eBay","*<p>This test case verifins the basic search\x3c/p>","*Functional","*Start test","*Open Browser","*SeleniumLibrary","*<p>Opens a new browser instance to the optional <code>url\x3c/code>.\x3c/p>","*${url}, ${browser}","*Opening browser 'chrome' to base url '<a href=\"https://www.ebay.com/\">https://www.ebay.com/\x3c/a>'.","*Maximize Browser Window","*<p>Maximizes current browser window.\x3c/p>","*Verify Search Results","*Input Text","*<p>Types the given <code>text\x3c/code> into the text field identified by <code>locator\x3c/code>.\x3c/p>","*//*[@id=\"gh-ac\"], mobile","*Typing text 'mobile' into text field '//*[@id=\"gh-ac\"]'.","*Press Keys","*<p>Simulates the user pressing key(s) to an element or on the active browser.\x3c/p>","*<a href=\"xpath://*[@id=&quot;gh-btn\">xpath://*[@id=\"gh-btn\x3c/a>\"], RETURN","*Sending key(s) ('RETURN',) to <a href=\"xpath://*[@id=&quot;gh-btn\">xpath://*[@id=\"gh-btn\x3c/a>\"] element.","*Pressing special key RETURN to element.","*Releasing special key RETURN.","*Page Should Contain","*<p>Verifies that current page contains <code>text\x3c/code>.\x3c/p>","*výsledků mobile","*Current page contains text 'výsledků mobile'.","*Finnish TestCase","*Close Browser","*<p>Closes the current browser.\x3c/p>"]); window.output["strings"] = window.output["strings"].concat(["*","*BasicSearch2","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Tests\\eBay\\BasicSearch2.robot","*../Tests/eBay/BasicSearch2.robot","*<p>Basic Search Funcianality\x3c/p>","*Verify basic search functionality foe eBay","*<p>This test case verifins the basic search\x3c/p>","*Functional","*Start test","*CommonFunctionality","*Open Browser","*SeleniumLibrary","*<p>Opens a new browser instance to the optional <code>url\x3c/code>.\x3c/p>","*${url}, ${browser}","*Opening browser 'chrome' to base url '<a href=\"https://www.ebay.com/\">https://www.ebay.com/\x3c/a>'.","*Maximize Browser Window","*<p>Maximizes current browser window.\x3c/p>","*Verify Search Results","*eBay_UserDefinedKeywords","*Input Text","*<p>Types the given <code>text\x3c/code> into the text field identified by <code>locator\x3c/code>.\x3c/p>","*//*[@id=\"gh-ac\"], mobile","*Typing text 'mobile' into text field '//*[@id=\"gh-ac\"]'.","*Press Keys","*<p>Simulates the user pressing key(s) to an element or on the active browser.\x3c/p>","*<a href=\"xpath://*[@id=&quot;gh-btn\">xpath://*[@id=\"gh-btn\x3c/a>\"], RETURN","*Sending key(s) ('RETURN',) to <a href=\"xpath://*[@id=&quot;gh-btn\">xpath://*[@id=\"gh-btn\x3c/a>\"] element.","*Pressing special key RETURN to element.","*Releasing special key RETURN.","*Page Should Contain","*<p>Verifies that current page contains <code>text\x3c/code>.\x3c/p>","*výsledků mobile","*Current page contains text 'výsledků mobile'.","*Filter results by condition","*Click Element","*<p>Click the element identified by <code>locator\x3c/code>.\x3c/p>","*//span[contains(text(),\"Stav\")]","*Clicking element '//span[contains(text(),\"Stav\")]'.","*Sleep","*BuiltIn","*<p>Pauses the test executed for the given time.\x3c/p>","*3s","*Slept 3 seconds","*//span[normalize-space()=\"Nový\"]","*Clicking element '//span[normalize-space()=\"Nový\"]'.","*Finnish TestCase","*Close Browser","*<p>Closes the current browser.\x3c/p>"]);
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["stats"] = [[{"elapsed":"00:01:20","fail":0,"label":"All Tests","pass":1,"skip":0}],[{"elapsed":"00:01:20","fail":0,"label":"Functional","pass":1,"skip":0}],[{"elapsed":"00:01:21","fail":0,"id":"s1","label":"BasicSearch","name":"BasicSearch","pass":1,"skip":0}]]; window.output["stats"] = [[{"elapsed":"00:00:14","fail":0,"label":"All Tests","pass":1,"skip":0}],[{"elapsed":"00:00:14","fail":0,"label":"Functional","pass":1,"skip":0}],[{"elapsed":"00:00:15","fail":0,"id":"s1","label":"BasicSearch2","name":"BasicSearch2","pass":1,"skip":0}]];
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["errors"] = []; window.output["errors"] = [];
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["baseMillis"] = 1697399410979; window.output["baseMillis"] = 1697481751804;
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["generated"] = 80679; window.output["generated"] = 14705;
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["expand_keywords"] = null; window.output["expand_keywords"] = null;

View File

@ -1,59 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<robot generator="Robot 6.1.1 (Python 3.11.4 on win32)" generated="20231015 21:50:10.975" rpa="false" schemaversion="4"> <robot generator="Robot 6.1.1 (Python 3.11.4 on win32)" generated="20231016 20:42:31.803" rpa="false" schemaversion="4">
<suite id="s1" name="BasicSearch" source="C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Mentor\Tests\eBay\BasicSearch.robot"> <suite id="s1" name="BasicSearch2" source="C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Mentor\Tests\eBay\BasicSearch2.robot">
<test id="s1-t1" name="Verify basic search functionality foe eBay" line="10"> <test id="s1-t1" name="Verify basic search functionality foe eBay" line="13">
<kw name="Start test"> <kw name="Start test" library="CommonFunctionality" type="SETUP">
<kw name="Open Browser" library="SeleniumLibrary"> <kw name="Open Browser" library="SeleniumLibrary">
<arg>${url}</arg> <arg>${url}</arg>
<arg>${browser}</arg> <arg>${browser}</arg>
<doc>Opens a new browser instance to the optional ``url``.</doc> <doc>Opens a new browser instance to the optional ``url``.</doc>
<msg timestamp="20231015 21:50:11.455" level="INFO">Opening browser 'chrome' to base url 'https://www.ebay.com/'.</msg> <msg timestamp="20231016 20:42:32.013" level="INFO">Opening browser 'chrome' to base url 'https://www.ebay.com/'.</msg>
<status status="PASS" starttime="20231015 21:50:11.454" endtime="20231015 21:51:06.529"/> <status status="PASS" starttime="20231016 20:42:32.013" endtime="20231016 20:42:35.756"/>
</kw> </kw>
<kw name="Maximize Browser Window" library="SeleniumLibrary"> <kw name="Maximize Browser Window" library="SeleniumLibrary">
<doc>Maximizes current browser window.</doc> <doc>Maximizes current browser window.</doc>
<status status="PASS" starttime="20231015 21:51:06.529" endtime="20231015 21:51:06.682"/> <status status="PASS" starttime="20231016 20:42:35.756" endtime="20231016 20:42:35.883"/>
</kw> </kw>
<status status="PASS" starttime="20231015 21:50:11.454" endtime="20231015 21:51:06.682"/> <status status="PASS" starttime="20231016 20:42:32.012" endtime="20231016 20:42:35.883"/>
</kw> </kw>
<kw name="Verify Search Results"> <kw name="Verify Search Results" library="eBay_UserDefinedKeywords">
<kw name="Input Text" library="SeleniumLibrary"> <kw name="Input Text" library="SeleniumLibrary">
<arg>//*[@id="gh-ac"]</arg> <arg>//*[@id="gh-ac"]</arg>
<arg>mobile</arg> <arg>mobile</arg>
<doc>Types the given ``text`` into the text field identified by ``locator``.</doc> <doc>Types the given ``text`` into the text field identified by ``locator``.</doc>
<msg timestamp="20231015 21:51:06.686" level="INFO">Typing text 'mobile' into text field '//*[@id="gh-ac"]'.</msg> <msg timestamp="20231016 20:42:35.885" level="INFO">Typing text 'mobile' into text field '//*[@id="gh-ac"]'.</msg>
<status status="PASS" starttime="20231015 21:51:06.684" endtime="20231015 21:51:06.976"/> <status status="PASS" starttime="20231016 20:42:35.884" endtime="20231016 20:42:35.999"/>
</kw> </kw>
<kw name="Press Keys" library="SeleniumLibrary"> <kw name="Press Keys" library="SeleniumLibrary">
<arg>xpath://*[@id="gh-btn"]</arg> <arg>xpath://*[@id="gh-btn"]</arg>
<arg>RETURN</arg> <arg>RETURN</arg>
<doc>Simulates the user pressing key(s) to an element or on the active browser.</doc> <doc>Simulates the user pressing key(s) to an element or on the active browser.</doc>
<msg timestamp="20231015 21:51:06.978" level="INFO">Sending key(s) ('RETURN',) to xpath://*[@id="gh-btn"] element.</msg> <msg timestamp="20231016 20:42:35.999" level="INFO">Sending key(s) ('RETURN',) to xpath://*[@id="gh-btn"] element.</msg>
<msg timestamp="20231015 21:51:29.047" level="INFO">Pressing special key RETURN to element.</msg> <msg timestamp="20231016 20:42:39.128" level="INFO">Pressing special key RETURN to element.</msg>
<msg timestamp="20231015 21:51:29.047" level="INFO">Releasing special key RETURN.</msg> <msg timestamp="20231016 20:42:39.128" level="INFO">Releasing special key RETURN.</msg>
<status status="PASS" starttime="20231015 21:51:06.976" endtime="20231015 21:51:29.065"/> <status status="PASS" starttime="20231016 20:42:35.999" endtime="20231016 20:42:39.268"/>
</kw> </kw>
<kw name="Page Should Contain" library="SeleniumLibrary"> <kw name="Page Should Contain" library="SeleniumLibrary">
<arg>výsledků mobile</arg> <arg>výsledků mobile</arg>
<doc>Verifies that current page contains ``text``.</doc> <doc>Verifies that current page contains ``text``.</doc>
<msg timestamp="20231015 21:51:29.132" level="INFO">Current page contains text 'výsledků mobile'.</msg> <msg timestamp="20231016 20:42:39.301" level="INFO">Current page contains text 'výsledků mobile'.</msg>
<status status="PASS" starttime="20231015 21:51:29.066" endtime="20231015 21:51:29.132"/> <status status="PASS" starttime="20231016 20:42:39.268" endtime="20231016 20:42:39.301"/>
</kw> </kw>
<status status="PASS" starttime="20231015 21:51:06.683" endtime="20231015 21:51:29.133"/> <status status="PASS" starttime="20231016 20:42:35.884" endtime="20231016 20:42:39.301"/>
</kw> </kw>
<kw name="Finnish TestCase"> <kw name="Filter results by condition" library="eBay_UserDefinedKeywords">
<kw name="Click Element" library="SeleniumLibrary">
<arg>//span[contains(text(),"Stav")]</arg>
<doc>Click the element identified by ``locator``.</doc>
<msg timestamp="20231016 20:42:39.302" level="INFO">Clicking element '//span[contains(text(),"Stav")]'.</msg>
<status status="PASS" starttime="20231016 20:42:39.302" endtime="20231016 20:42:39.347"/>
</kw>
<kw name="Sleep" library="BuiltIn">
<arg>3s</arg>
<doc>Pauses the test executed for the given time.</doc>
<msg timestamp="20231016 20:42:42.347" level="INFO">Slept 3 seconds</msg>
<status status="PASS" starttime="20231016 20:42:39.347" endtime="20231016 20:42:42.347"/>
</kw>
<kw name="Click Element" library="SeleniumLibrary">
<arg>//span[normalize-space()="Nový"]</arg>
<doc>Click the element identified by ``locator``.</doc>
<msg timestamp="20231016 20:42:42.347" level="INFO">Clicking element '//span[normalize-space()="Nový"]'.</msg>
<status status="PASS" starttime="20231016 20:42:42.347" endtime="20231016 20:42:44.205"/>
</kw>
<status status="PASS" starttime="20231016 20:42:39.302" endtime="20231016 20:42:44.205"/>
</kw>
<kw name="Finnish TestCase" library="CommonFunctionality" type="TEARDOWN">
<kw name="Close Browser" library="SeleniumLibrary"> <kw name="Close Browser" library="SeleniumLibrary">
<doc>Closes the current browser.</doc> <doc>Closes the current browser.</doc>
<status status="PASS" starttime="20231015 21:51:29.134" endtime="20231015 21:51:31.641"/> <status status="PASS" starttime="20231016 20:42:44.206" endtime="20231016 20:42:46.501"/>
</kw> </kw>
<status status="PASS" starttime="20231015 21:51:29.133" endtime="20231015 21:51:31.642"/> <status status="PASS" starttime="20231016 20:42:44.205" endtime="20231016 20:42:46.501"/>
</kw> </kw>
<doc>This test case verifins the basic search</doc> <doc>This test case verifins the basic search</doc>
<tag>Functional</tag> <tag>Functional</tag>
<status status="PASS" starttime="20231015 21:50:11.452" endtime="20231015 21:51:31.642"/> <status status="PASS" starttime="20231016 20:42:32.012" endtime="20231016 20:42:46.503"/>
</test> </test>
<doc>Basic Search Funcianality</doc> <doc>Basic Search Funcianality</doc>
<status status="PASS" starttime="20231015 21:50:10.979" endtime="20231015 21:51:31.644"/> <status status="PASS" starttime="20231016 20:42:31.804" endtime="20231016 20:42:46.504"/>
</suite> </suite>
<statistics> <statistics>
<total> <total>
@ -63,7 +84,7 @@
<stat pass="1" fail="0" skip="0">Functional</stat> <stat pass="1" fail="0" skip="0">Functional</stat>
</tag> </tag>
<suite> <suite>
<stat pass="1" fail="0" skip="0" id="s1" name="BasicSearch">BasicSearch</stat> <stat pass="1" fail="0" skip="0" id="s1" name="BasicSearch2">BasicSearch2</stat>
</suite> </suite>
</statistics> </statistics>
<errors> <errors>

View File

@ -1629,22 +1629,22 @@ storage = function () {
window.output = {}; window.output = {};
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["suite"] = [1,2,3,4,[],[1,0,80665],[],[[5,0,6,[7],[1,473,80190],[]]],[],[1,1,0,0]]; window.output["suite"] = [1,2,3,4,[],[1,0,14700],[],[[5,0,6,[7],[1,208,14491],[]]],[],[1,1,0,0]];
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["strings"] = []; window.output["strings"] = [];
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["strings"] = window.output["strings"].concat(["*","*BasicSearch","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Tests\\eBay\\BasicSearch.robot","*../Tests/eBay/BasicSearch.robot","*<p>Basic Search Funcianality\x3c/p>","*Verify basic search functionality foe eBay","*<p>This test case verifins the basic search\x3c/p>","*Functional"]); window.output["strings"] = window.output["strings"].concat(["*","*BasicSearch2","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Tests\\eBay\\BasicSearch2.robot","*../Tests/eBay/BasicSearch2.robot","*<p>Basic Search Funcianality\x3c/p>","*Verify basic search functionality foe eBay","*<p>This test case verifins the basic search\x3c/p>","*Functional"]);
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["stats"] = [[{"elapsed":"00:01:20","fail":0,"label":"All Tests","pass":1,"skip":0}],[{"elapsed":"00:01:20","fail":0,"label":"Functional","pass":1,"skip":0}],[{"elapsed":"00:01:21","fail":0,"id":"s1","label":"BasicSearch","name":"BasicSearch","pass":1,"skip":0}]]; window.output["stats"] = [[{"elapsed":"00:00:14","fail":0,"label":"All Tests","pass":1,"skip":0}],[{"elapsed":"00:00:14","fail":0,"label":"Functional","pass":1,"skip":0}],[{"elapsed":"00:00:15","fail":0,"id":"s1","label":"BasicSearch2","name":"BasicSearch2","pass":1,"skip":0}]];
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["baseMillis"] = 1697399410979; window.output["baseMillis"] = 1697481751804;
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["generated"] = 80679; window.output["generated"] = 14705;
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
window.output["expand_keywords"] = null; window.output["expand_keywords"] = null;

View File

@ -22,6 +22,7 @@ Start test
Verify Search Results Verify Search Results
input text //*[@id="gh-ac"] mobile input text //*[@id="gh-ac"] mobile
# kliknout na tlačítko můžeme více způsoby
#click button xpath://*[@id="gh-btn"] #click button xpath://*[@id="gh-btn"]
press keys xpath://*[@id="gh-btn"] RETURN press keys xpath://*[@id="gh-btn"] RETURN
page should contain výsledků mobile page should contain výsledků mobile

View File

@ -0,0 +1,25 @@
*** Settings ***
Documentation Basic Search Funcianality
Resource ../../Resources/CommonFunctionality.robot
Resource ../../Resources/eBay_UserDefinedKeywords.robot
Test Setup CommonFunctionality.Start test
Test Teardown CommonFunctionality.Finnish TestCase
*** Variables ***
*** Test Cases ***
Verify basic search functionality foe eBay
[Documentation] This test case verifins the basic search
[Tags] Functional
eBay_UserDefinedKeywords.Verify Search Results
eBay_UserDefinedKeywords.Filter results by condition
#CommonFunctionality.Verify filter results