vim_test.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package test
  2. import (
  3. "testing"
  4. . "github.com/onsi/ginkgo"
  5. . "github.com/onsi/gomega"
  6. )
  7. func TestVim(t *testing.T) {
  8. RegisterFailHandler(Fail)
  9. RunSpecs(t, "Integration tests")
  10. }
  11. var _ = Describe("Vim tests", func() {
  12. BeforeEach(func() {
  13. GotoURL(testSiteURL + "/smorgasbord/")
  14. })
  15. It("should navigate to a new page by using a link hint", func() {
  16. Expect("Another▄page").To(BeInFrameAt(12, 18))
  17. Keyboard("f")
  18. Keyboard("a")
  19. Expect("Another").To(BeInFrameAt(0, 0))
  20. })
  21. It("should scroll the page by one line", func() {
  22. Expect("[ˈsmœrɡɔsˌbuːɖ])▄is▄a").To(BeInFrameAt(12, 11))
  23. Keyboard("j")
  24. Expect("type▄of▄Scandinavian▄").To(BeInFrameAt(12, 11))
  25. })
  26. Describe("Tabs", func() {
  27. BeforeEach(func() {
  28. ensureOnlyOneTab()
  29. })
  30. It("should create a new tab", func() {
  31. Keyboard("t")
  32. Expect("New Tab").To(BeInFrameAt(21, 0))
  33. })
  34. It("should cycle to the next tab", func() {
  35. GotoURL(testSiteURL + "/smorgasbord/")
  36. Keyboard("t")
  37. GotoURL(testSiteURL + "/smorgasbord/another.html")
  38. Keyboard("J")
  39. URL := testSiteURL + "/smorgasbord/ "
  40. Expect(URL).To(BeInFrameAt(0, 1))
  41. })
  42. })
  43. })