Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Add the test suite #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add the test suite #2

wants to merge 6 commits into from

Conversation

jwilk
Copy link
Contributor

@jwilk jwilk commented Jan 30, 2016

This is the test suite I've sent you in private, and which Debian has been carrying for a while (hi @spwhitton).

I don't expect you to merge it right now. Unfortunately, it doesn't work at the moment:

  • xdotool, which the test suite uses to interact with Firefox, is broken.
  • The Firefox UI for certificate errors has been just redesigned in Firefox 44 (passport dude is gone!) and I haven't updated the code to take this into account.

Do we want this to be a part of the xpi file? If yes, then I should probably move it to src/.

For the moment the test requires that the extension is installed system-wide. It would be cool if it was possible to also test against the unpacked source. I haven't figured out how to do it yet.

@jwilk
Copy link
Contributor Author

jwilk commented Jan 31, 2016

I've fixed support for Firefox 44.

@spwhitton
Copy link

Thanks for a nice summary of why the test suite is failing, jwilk. I hope xdotool gets fixed soon.

Instead of sending keys directly to a specific window, activate the
window, then send the keys to the active window.

This is work-around for an xdotool bug[0], which broke sending synthetic
keys, such as Ctrl+F, to a specific window.

The downside of this approach is that the user could break the test if
they switched to another window while the test is running. This is not a
big deal, because one should run automated tests in an isolated
environment (for example, under Xvfb) anyway.

This commit should be reverted once the xdotool bug is fixed.

[0] jordansissel/xdotool#52
@jwilk
Copy link
Contributor Author

jwilk commented Jan 31, 2016

I've implemented work-around for the xdotool bug.
Wheee!

@jwilk
Copy link
Contributor Author

jwilk commented Jan 31, 2016

I forogot to mention that now I'm getting these warnings from xdotool:

XGetWindowProperty[_NET_WM_DESKTOP] failed (code=1)

They seem harmless, but I'll investigate further.

@spwhitton
Copy link

Hello @jwilk. I'm getting this error when I try to run the test suite:

[1] untrusted connection ... ok
[1] open "add security exception" dialog ... Your windowmanager claims not to support _NET_ACTIVE_WINDOW, so the attempt to activate the window was aborted.

According to this thread this is because xvfb's built-in window manager doesn't support EWMHs. Fair enough, but in that case how did you ever make the test suite run? I think I must be missing something.

@spwhitton
Copy link

Ah, that problem was caused by your xdotool workaround which I needed to drop. Unfortunately, the test suite is now timing out:

autopkgtest [09:12:56]: test testsuite: [-----------------------
[1] untrusted connection ... ok
[1] open "add security exception" dialog ... ok
[1] add security exception ... TIMEOUT
Traceback (most recent call last):
  File "./test/run", line 109, in <module>
    main()
  File "./test/run", line 61, in main
    _main()
  File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/tmp/autopkgtest.ndvXJ4/autopkgtest_tmp/test/firefox.py", line 147, in clean_home_dir
    yield
  File "./test/run", line 61, in main
    _main()
  File "./test/run", line 83, in _main
    'alt+c',
  File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "./test/run", line 46, in check
    yield
  File "./test/run", line 83, in _main
    'alt+c',
  File "/tmp/autopkgtest.ndvXJ4/autopkgtest_tmp/test/firefox.py", line 93, in talk
    ipc.check_call(cmdline)
  File "/usr/lib/python3.5/subprocess.py", line 576, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.5/subprocess.py", line 559, in call
    return p.wait(timeout=timeout)
  File "/usr/lib/python3.5/subprocess.py", line 1658, in wait
    (pid, sts) = self._try_wait(0)
  File "/usr/lib/python3.5/subprocess.py", line 1608, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
  File "./test/run", line 36, in raise_
    raise Timeout
__main__.Timeout
autopkgtest [09:13:21]: test testsuite: -----------------------]

Is there some way I can make the output more verbose?

@jwilk
Copy link
Contributor Author

jwilk commented Jun 22, 2016

I probably only tested under a real X server. Oops.
Lack of _NET_ACTIVE_WINDOW support can be worked around by running a window manager under Xvfb. For example, this seems to work for me:

xvfb-run sh -c 'i3 & test/run' 

The timeout is expected if 0c224ce was not applied.
The test waits for a window to appear, but it will never happen, because xdotool sent the wrong keys...

@spwhitton
Copy link

Thanks for the feedback.

After installing i3, I tried running the command you suggested but it
still times out while adding the security exception. I have 0c224ce
applied (as a quilt patch, with the stack pushed).

Could you the version of Firefox you're using?

Sean Whitton

@jwilk
Copy link
Contributor Author

jwilk commented Jun 22, 2016 via email

Use Escape followed by Shift+Tab to select buttons after searching for
their label.

Shift+Tab alone, which is was what used previously, happened to work
only by accident, and broke in Firefox 46.

Thanks to Sean Whitton for the bug report.
@jwilk
Copy link
Contributor Author

jwilk commented Jun 22, 2016

ca7b79e fixed it at least for Firefox 47.0.

The previous approach of enabling the extension in extensions.ini was
unnecessarily complicated and stopped working with Firefox 48.
@jwilk
Copy link
Contributor Author

jwilk commented Aug 4, 2016

In d43c78c, I fixed compatibility with Firefox 48.

@spwhitton
Copy link

Hello @jwilk. The test suite is failing at present. I'm not yet sure if this is a temporary failure or an incompatibility with Firefox 50.

@jwilk
Copy link
Contributor Author

jwilk commented Dec 9, 2016 via email

@spwhitton
Copy link

spwhitton commented Dec 10, 2016 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants