Testing dojo. Вступительная презентация

Post on 30-Jul-2015

23 views 2 download

Transcript of Testing dojo. Вступительная презентация

Testing Dojo

Application

K1K2

K3

...

Release 1

time30 min

Release 2 Release 6

time30 min

test

com

mit

com

mit

test

test

com

mit

com

mit

test

2 Tests passed

7 Tests passedK1

K2

K3

3 Tests faled 1 passed

Начисление очков

+10 (+8, + 6, +2) Найденная баг

-100 Assert.IsTrue(True)

0 Бага нет, тест есть

-10 Бага есть, тест зелёный

-10 Бага нет, тест красный

∑ -10 iterations

Каждый ненайденный баг

2 1 3

Tests naming

class ReleaseX<TestClassName>Tests{

void Bug<BugName>

void <TestName>}

C#

Python def test_bugX_<bag_name>

def test_<test_name>

где X - версия продукта

WebDriver

click

send text

yes

no

click

chrome, ie, firefox,...

Selenium 2.0 → 3.0

W3C working draft 2013

JsonWireProtocol

Get element text (JSON Wire Example)

HTTP/1.1 200 OK

Content-Type: application/json;charset=UTF-8

Connection: close

{"sessionId":"Awesome", "status":0, "value":"Testing Dojo"}

GET http://127.0.0.1:9999/session/Awesome/element/2026335-1/text HTTP/1.1

...

Content-Type: application/json;charset=UTF-8

Connection: close

Accept: application/json

14

∀ (С#, Python, Java...)

WebDriverclick

Json

Wire

Pro

toco

l

click

bindings

driver.find_element_by_id('SetTextButton').click()

Поиск элемента

driver.find_element_by_id('SetTextButton').click()

find_element_by_name

find_element_by_css_selector

find_element_by_xpath

find_element_by_class_name

Поиск элемента

Как это работает в Desktop?

Click

windows desktopapplication

Winium.Desktop

Cruciatusclick

Json

Wire

Pro

toco

l

click

Winium Driver

∀ (С#, Python, Java...)

bindings

# put it in setUp

self.driver =

webdriver.Remote(command_executor='http://localhost:9999',

desired_capabilities={'app': 'C:\\testApp.exe'})

# put it in test method body

win = self.driver.find_element_by_id('WpfTestApplicationMainWindow')

win.find_element_by_id('SetTextButton').click()

assert 'CARAMBA' == self.driver.find_element_by_id('MyTextBox').text

Пример теста