Currently tests are broken because no way to properly generate CSRF token from web tests. The related issue is #1555862: DrupalWebTestCase::drupalGetToken() does not add hash salt
Suppose that's because to way to get CSRF seed from user session of logged in user...

Also we need to add tests for
- unit test coverage for service, access checks, form and block
- web tests for exposed UI elements: user extra field, block autocomplete, menu links

Comments

andypost’s picture

  • andypost committed 175c6b1 on 8.x-2.x
    Issue #2448707 by andypost: Fix masquerade tests
    
andypost’s picture

Status: Active » Fixed

Tests are fixed and extended for role permissions
Waiting for branch test to publish alpha release

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

andypost’s picture

Looks tests running against 8.2.x but manual testing shows that all works

Drupal test run
---------------

Tests to be run:
  - Drupal\masquerade\Tests\MasqueradeAccessTest
  - Drupal\masquerade\Tests\MasqueradeCacheTest
  - Drupal\masquerade\Tests\MasqueradeTest

Test run started:
  Wednesday, March 16, 2016 - 23:32

Test summary
------------

Drupal\masquerade\Tests\MasqueradeTest                        45 passes                                      
Drupal\masquerade\Tests\MasqueradeCacheTest                   38 passes                                      
Drupal\masquerade\Tests\MasqueradeAccessTest                 222 passes                                      

Test run duration: 54 sec
andypost’s picture

Called retest, still passed locally

$ d8t --module masquerade

Drupal test run
---------------

Tests to be run:
  - Drupal\masquerade\Tests\MasqueradeAccessTest
  - Drupal\masquerade\Tests\MasqueradeCacheTest
  - Drupal\masquerade\Tests\MasqueradeTest

Test run started:
  Wednesday, June 22, 2016 - 14:21

Test summary
------------

Drupal\masquerade\Tests\MasqueradeTest                        45 passes                                      
Drupal\masquerade\Tests\MasqueradeCacheTest                   38 passes                                      
Drupal\masquerade\Tests\MasqueradeAccessTest                 222 passes                                      

Test run duration: 2 min 22 sec
andypost’s picture

Status: Active » Needs review
StatusFileSize
new6.35 KB

Clean-up of codestyle, somehow bots can't find route to unmasquerade

andypost’s picture

so the same 5 failures, but access test actually passing

12:09:59 Drupal\masquerade\Tests\MasqueradeTest                        38 passes   5 fails                            
12:10:00 Drupal\masquerade\Tests\MasqueradeCacheTest                   38 passes                                      
12:10:03 Drupal\masquerade\Tests\MasqueradeAccessTest                 209 passes    
andypost’s picture

Commited the patch above, looks only first test fails and access test is just killed by JS testing https://dispatcher.drupalci.org/job/default/156489/console

andypost’s picture

andypost’s picture

locally tests pass

andypost’s picture

StatusFileSize
new3.6 KB
Drupal test run
---------------

Tests to be run:
  - Drupal\masquerade\Tests\MasqueradeAccessTest
  - Drupal\masquerade\Tests\MasqueradeCacheTest
  - Drupal\masquerade\Tests\MasqueradeTest

Test run started:
  Tuesday, May 23, 2017 - 23:13

Test summary
------------

Drupal\masquerade\Tests\MasqueradeTest                        45 passes                                      
Drupal\masquerade\Tests\MasqueradeCacheTest                   38 passes                                      
Drupal\masquerade\Tests\MasqueradeAccessTest                 222 passes                                      

Test run duration: 22 sec
andypost’s picture

StatusFileSize
new4.78 KB
andypost’s picture

StatusFileSize
new5.08 KB
andypost’s picture

StatusFileSize
new252 bytes
new5.08 KB

The last submitted patch, 13: test-13.patch, failed testing.

The last submitted patch, 13: test-13.patch, failed testing.

The last submitted patch, 14: test-14.patch, failed testing.

The last submitted patch, 14: test-14.patch, failed testing.

The last submitted patch, 15: test-15.patch, failed testing.

The last submitted patch, 15: test-15.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 16: test-16.patch, failed testing.

andypost’s picture

New issue #2923960: Convert Simpletest tests to BrowserTestBase

Patch from this one should be moved to new one - convert array syntax

andypost’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.