Codeception Acceptance test confused by overlaid tabs
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Bug
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- php
- Domínio
- testing-qa
Direção de pesquisa
Comece pelo comportamento do módulo WebDriver por trás de waitForElementVisible(), see(), click(), performOn() e clickWithRightButton() quando usados em abas sobrepostas. Reproduza a sequência relatada com um fixture mínimo de abas, se possível; considera-se concluído quando as verificações de visibilidade e os cliques sempre têm como alvo os elementos atualmente visíveis, sem workarounds manuais.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
What are you trying to achieve?
Run an Acceptance test on a set of tabs.
What do you get instead?
A variety of errors where $I can click on elements I can't see and can't see elements that I can click on.
Sometimes using performOn() solves the problem, sometimes it causes problems where see and click work.
I have four tabs (not browser tabs). They are overlaid except for the tab headings.
Each tab contains a button (in the same location) that reloads a grid.
In a loop, I select a tab by clicking on a heading then on the reload button, then perform a series of tests involving clicking and right-clicking on the grid.
All four tab heading are always visible, but after the first pass, Codeception considers them visible but can't see them. All selectors are unique in these examples.
$element = "#orphans-{$nameLower}s-reload";
$I->waitForElementVisible($element, 5);
// $I->see($element); // fails
$I->click($element);
The test above works as is, but fails when I uncomment the second line.
/* Test Rename grid item /*
$I->clickWithRightButton("//div[text() = '" . oPageVariables::$namePrefix . $name . "']");
$I->waitForElement("//span[text() = 'Rename {$name}(s)']");
$I->see("//span[text() = 'Rename {$name}(s)']");
$I->click("//span[text() = 'Rename {$name}(s)']"); // fails
This is the opposite problem. All tests succeed except the last one.
Replacing some of these with performOn(), solves the problem in some cases, but in other cases, replacing working code with performOn() fails.
My suspicion is that elements and their characteristics are cached on page load and not not updated when a new tab is selected. It also appears that tab headings of non-active tabs are considered invisible after the first tab is selected.
All operations work perfectly when done manually. I can make all tests pass with a lot of fiddling but no change in the source or logic (so all selectors are correct). I'm just pointing out that in an app that works fine, acceptance test operations that should work, don't when there are overlaid tabs.
I wish I could provide example code, but the code operates in the main page of a CMS, so it's massive (mostly generated by ExtJS 3) and deeply nested. I don't think it would help.
There's nothing useful in the command-line run output, even with -vvv. It just shows which tests pass and which fail.
Details
-
Codeception version:
-
PHP Version: 2.5.2
-
Operating System: Windows 10
-
Installation type: Composer
-
List of installed packages (
composer show)
behat/gherkin v4.5.1 Gherkin DSL parser for PHP 5.3
codeception/codeception 2.5.2 BDD-style testing framework
codeception/phpunit-wrapper 7.6.1 PHPUnit classes used by Codeception
codeception/stub 2.0.4 Flexible Stub wrapper for PHPUnit's Mock Builder
doctrine/instantiator 1.1.0 A small, lightweight utility to instantiate object...
facebook/webdriver 1.6.0 A PHP client for Selenium WebDriver
guzzlehttp/guzzle 6.3.3 Guzzle is a PHP HTTP client library
guzzlehttp/promises v1.3.1 Guzzle promises library
guzzlehttp/psr7 1.5.2 PSR-7 message implementation that also provides co...
myclabs/deep-copy 1.8.1 Create deep copies (clones) of your objects
phar-io/manifest 1.0.3 Component for reading phar.io manifest information...
phar-io/version 2.0.1 Library for handling version information and const...
phpdocumentor/reflection-common 1.0.1 Common reflection classes used by phpdocumentor to...
phpdocumentor/reflection-docblock 4.3.0 With this component, a library can provide support...
phpdocumentor/type-resolver 0.4.0
phpspec/prophecy 1.8.0 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 6.1.4 Library that provides collection, processing, and ...
phpunit/php-file-iterator 2.0.2 FilterIterator implementation that filters files b...
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 2.0.0 Utility class for timing
phpunit/php-token-stream 3.0.1 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 7.5.1 The PHP Unit Testing framework.
psr/http-message 1.0.1 Common interface for HTTP messages
ralouphie/getallheaders 2.0.5 A polyfill for getallheaders.
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code b...
sebastian/comparator 3.0.2 Provides the functionality to compare PHP values f...
sebastian/diff 3.0.1 Diff implementation
sebastian/environment 4.0.1 Provides functionality to handle HHVM/PHP environm...
sebastian/exporter 3.1.0 Provides the functionality to export PHP variables...
sebastian/global-state 2.0.0 Snapshotting of global state
sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to en...
sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including ...
sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP ...
sebastian/resource-operations 2.0.1 Provides a list of PHP built-in functions that ope...
sebastian/version 2.0.1 Library that helps with managing the version numbe...
symfony/browser-kit v4.2.2 Symfony BrowserKit Component
symfony/console v4.2.2 Symfony Console Component
symfony/contracts v1.0.2 A set of abstractions extracted out of the Symfony...
symfony/css-selector v4.2.2 Symfony CssSelector Component
symfony/dom-crawler v4.2.2 Symfony DomCrawler Component
symfony/event-dispatcher v4.2.2 Symfony EventDispatcher Component
symfony/finder v4.2.2 Symfony Finder Component
symfony/polyfill-ctype v1.10.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring v1.10.0 Symfony polyfill for the Mbstring extension
symfony/process v4.2.2 Symfony Process Component
symfony/yaml v4.2.2 Symfony Yaml Component
theseer/tokenizer 1.1.0 A small library for converting tokenized PHP sourc...
webmozart/assert 1.4.0 Assertions to validate method input/output with ni... -
Suite configuration:
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
actor: AcceptanceTester
modules:
enabled:
- \Helper\Acceptance
- WebDriver
- Asserts
config:
WebDriver:
url: 'http://localhost/test/'
browser: 'chrome'
window_size: 'maximize'
wait: 5
# window_size: false
#capabilities:
# chromeOptions:
#args: ["--headless", "--disable-gpu", "--disable-extensions"]
extensions:
enabled:
- Codeception\Extension\RunProcess:
- java -jar c:/Users/BobRay/Downloads/Selenium/selenium-server-standalone-3.9.0.jar
- C:/Users/BobRay/Downloads/selenium-drivers/chromedriver.exe
- Linguagem predominante
- PHP
- Estrelas
- 39
- Forks
- 25
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Codeception/module-webdriver
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Codeception/module-webdriver#151 · 1 comentário ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
Codeception/module-webdriver#135 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 38/100
Codeception/module-webdriver#130 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Codeception/module-webdriver#128 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 45/100
Codeception/module-webdriver#126 ·
Todas as issues de Codeception/module-webdriver
Issues semelhantes
-
Daemon delete dialog: "Remove all ExApps" checkbox and `removeExApps` parameter have no effectAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
Mantenedores costumam responder em até 1 dia
-
[Sync EN] Fix session read handler docs: false reports a failure, not a missing session (#5902)Abertasync-en
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
[Sync EN] Fix session read handler docs: false reports a failure, not a missing session (#5902)Abertasync-en
Dificuldade 2/5 1-2 dias Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 2 dias
-
feature-request needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
aws/aws-sdk-php#3365 ·
Mantenedores costumam responder em até 1 dia