Skip to content

Commit

Permalink
Merge pull request #59 from t3n/webandco-master
Browse files Browse the repository at this point in the history
Neos 5.0 Update
  • Loading branch information
johannessteu authored Jan 9, 2020
2 parents 7bba8b7 + 94b27b8 commit 3e62021
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 133 deletions.
6 changes: 5 additions & 1 deletion Classes/Aspect/CollectDebugInformationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ public function debuggingActive(): void
public function addDebugValues(JoinPointInterface $joinPoint): string
{
$startRenderAt = microtime(true) * 1000;
$output = $joinPoint->getAdviceChain()->proceed($joinPoint);
$endRenderAt = microtime(true) * 1000;
$output = $joinPoint->getAdviceChain()->proceed($joinPoint);

if ($output instanceof \GuzzleHttp\Psr7\Response) {
$output = $output->getBody()->getContents();
}

$data = [
'startRenderAt' => $startRenderAt,
Expand Down
4 changes: 2 additions & 2 deletions Resources/Public/Script/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ window.__enable_neos_debug__ = (setCookie = false) => {
}

if (setCookie) {
document.cookie = '__neos_debug__=true';
document.cookie = '__neos_debug__=true;path=/';
}

console.log('%c Starting Neos Debug Tool ... ', 'color: white; background: #f9423a; line-height: 20px; font-weight: bold');
Expand Down Expand Up @@ -397,7 +397,7 @@ window.__enable_neos_debug__ = (setCookie = false) => {
infoVisible && infoElements.forEach(e => e.hide());
listVisible && cacheTable.hide();
window.__enable_neos_debug__.active = false;
document.cookie = '__neos_debug__=; expires=Thu, 01 Jan 1970 00:00:00 UTC;';
document.cookie = '__neos_debug__=; expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/';
console.log('%c Closing Neos Debug Tool> ', 'color: white; background: #f9423a; line-height: 20px; font-weight: bold');
});

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"type": "neos-package",
"require": {
"neos/neos": "~3.3.0 || ~4.0"
"neos/neos": "~3.3.0 || ~4.0 || ~5.0"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions composer.json.ci
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"bin-dir": "bin"
},
"require": {
"neos/neos": "~4.3.0",
"neos/nodetypes": "~4.3.0",
"neos/demo": "^5.0",
"neos/buildessentials": "~5.3.0",
"neos/neos": "^5.1",
"neos/nodetypes": "^5.1",
"neos/demo": "^6.1",
"neos/buildessentials": "^6.1",
"t3n/neos-debug": "@dev",
"t3n/coding-standard": "~1.0.0"
},
Expand Down
59 changes: 29 additions & 30 deletions e2e/cypress/integration/debug-console/usage.ts
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
/// <reference types="Cypress" />
/// <reference types="Cypress-testing-library" />

describe('debug console can be used at all', () => {
it('console can be opened and closed', () => {
describe("debug console can be used at all", () => {
it("console can be opened and closed", () => {
// the console is not there yet+
cy.visit('/')
.queryByText(/render time/i)
.should('not.exist');
cy.visit("/")
.queryByText(/cache \(/i)
.should("not.exist");

// bring up the console
cy.openConsole()
.queryByText(/render time/i)
.should('exist')
.queryByText(/cache \(/i)
.should("exist")
.queryByText(/close/i)
.should('exist');
.should("exist");

// close it
cy.window()
.queryByText(/close/i)
.click()
.queryByText(/render time/i)
.should('not.exist');
.queryByText(/cache \(/i)
.should("not.exist");
});

it('cookie can be set so console stays on a refresh', () => {
cy.visit('/')
.queryByText(/render time/i)
.should('not.exist');
it("cookie can be set so console stays on a refresh", () => {
cy.visit("/")
.queryByText(/cache \(/i)
.should("not.exist");

// bring up the console
cy.openConsole(true)
.queryByText(/render time/i)
.should('exist')
.getCookie('__neos_debug__')
.should('have.property', 'value')
.should('eq', 'true')
.queryByText(/render time/i)
.should('exist');
.queryByText(/cache \(/i)
.should("exist")
.getCookie("__neos_debug__")
.should("have.property", "value")
.should("eq", "true");
});

it('debug console opens when the cookie is set', () => {
cy.setCookie('__neos_debug__', 'true')
.visit('/')
.queryByText(/render time/i);
it("debug console opens when the cookie is set", () => {
cy.setCookie("__neos_debug__", "true")
.visit("/")
.queryByText(/cache \(/i)
.should("exist");
});

it('closing the console will also delete the cooke', () => {
cy.setCookie('__neos_debug__', 'true')
.visit('/')
it("closing the console will also delete the cooke", () => {
cy.setCookie("__neos_debug__", "true")
.visit("/")
.queryByText(/close/i)
.click()
.getCookie('__neos_debug__')
.should('eq', null);
.getCookie("__neos_debug__")
.should("eq", null);
});
});
4 changes: 2 additions & 2 deletions e2e/cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <reference types="Cypress" />
// <reference types="Cypress-testing-library" />

import '@testing-library/cypress/add-commands';
import './commands';
import "@testing-library/cypress/add-commands";
import "./commands";
2 changes: 1 addition & 1 deletion e2e/cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"baseUrl": "../node_modules",
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "cypress-testing-library"]
"types": ["cypress", "@types/testing-library__cypress"]
},
"include": ["**/*.ts"]
}
Loading

0 comments on commit 3e62021

Please sign in to comment.