mirror of https://github.com/RubaXa/Sortable.git
Lebedev Konstantin
7 years ago
committed by
GitHub
6 changed files with 76 additions and 15 deletions
File diff suppressed because one or more lines are too long
@ -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