无法滚动导航菜单

时间:2018-12-01 23:16:57

标签: automated-tests e2e-testing testcafe

我正在使用Testcafe。 我在单击导航栏底部的元素时遇到问题。


测试网址:https://devexpress.github.io/testcafe/documentation/test-api/

测试代码:

import {Selector} from 'testcafe'

fixture('scroll')

test('Can scroll sidebar', async t => {
    await t
        .navigateTo('https://devexpress.github.io/testcafe/documentation/test-api/')
        .resizeWindow(1280, 600)
        .click(Selector('a').withText('TypeScript Support'))
})

我想滚动导航栏并单击TypeScript Support链接,但是整个窗口都是滚动的,而不是导航栏。这里有任何解决方法吗?

1 个答案:

答案 0 :(得分:2)

导航菜单使用自定义滚动机制,因此自动滚动机制不起作用。 您应该使用the drag action手动滚动到所需的菜单项,例如:.drag('.ps-scrollbar-y', 0, 600)

相关问题