You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
koreader/spec/unit/readerdictionary_spec.lua

34 lines
1.1 KiB
Lua

require("commonrequire")
local DocumentRegistry = require("document/documentregistry")
local ReaderUI = require("apps/reader/readerui")
local lfs = require("libs/libkoreader-lfs")
local UIManager = require("ui/uimanager")
local Screen = require("device").screen
local Event = require("ui/event")
local DEBUG = require("dbg")
describe("Readerdictionary module", function()
local sample_epub = "spec/front/unit/data/leaves.epub"
local readerui, rolling, dictionary
setup(function()
readerui = ReaderUI:new{
document = DocumentRegistry:openDocument(sample_epub),
}
rolling = readerui.rolling
dictionary = readerui.dictionary
end)
it("should show quick lookup window", function()
local name = "screenshots/reader_dictionary.png"
UIManager:quit()
UIManager:show(readerui)
rolling:onGotoPage(100)
dictionary:onLookupWord("test")
UIManager:scheduleIn(1, function()
UIManager:close(dictionary.dict_window)
UIManager:close(readerui)
end)
UIManager:run()
Screen:shot(name)
end)
end)