mirror of https://github.com/RubaXa/Sortable.git
miherlosev@mail.ru
8 years ago
4 changed files with 59 additions and 5 deletions
@ -0,0 +1,14 @@
|
||||
import { Selector } from 'testcafe'; |
||||
|
||||
export default class IndexPage { |
||||
constructor () { |
||||
const listAContainer = Selector('#foo'); |
||||
const listAItems = listAContainer.find('li'); |
||||
|
||||
this.listA = { |
||||
container: listAContainer, |
||||
items: listAItems, |
||||
getItem: text => listAItems.withText(text) |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
import IndexPage from './index-page-model'; |
||||
|
||||
const indexPage = new IndexPage(); |
||||
|
||||
fixture `Tests` |
||||
.page('http://localhost:8080/index.html'); |
||||
|
||||
test('List A', async t => { |
||||
const listA = indexPage.listA; |
||||
const firstItem = listA.items.nth(0); |
||||
const secondItem = listA.items.nth(1); |
||||
const hippoText = 'Бегемот'; |
||||
const foodText = 'Корм'; |
||||
|
||||
await t |
||||
.expect(firstItem.innerText).eql(hippoText) |
||||
.expect(secondItem.innerText).eql(foodText) |
||||
.dragToElement(firstItem, secondItem, { speed: 0.5 }) |
||||
.expect(firstItem.innerText).eql(foodText) |
||||
.expect(secondItem.innerText).eql(hippoText); |
||||
}); |
||||
|
Loading…
Reference in new issue