You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our application, we have a bunch of junk messages from third-party components that we can't turn off.
Sample
info: %cDownload the React DevTools for a better development experience: https://fb.me/react-devtools font-weight:bold
warning: Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.
For our Selenium tests, we have a bit of glue code to get the browser logs and clean the things we don't care about:
The Apparition documentation states that the way to control output from console.* statements is via browser_logger, much the same as Poltergeist:
:browser_logger (IO object) - This is where your console.log statements will show up. Default: STDOUT
Unfortunately, by being IO-based, it becomes difficult to perform any filtering. For example, the write call might include data unrelated to the target message or the target message might be split into multiple calls.
Examples
write: "this is a very important message\nAnd this is a different one from React DevTools"
write: "React "
write: "DevTools"
Would it be possible to transfer these browser messages in a more structured manner so that they are easier to work with?
The text was updated successfully, but these errors were encountered:
That does look promising, thank you! Can you point me towards the documentation I missed so I can find this kind of thing without bothering you next time?
From some experimentation:
#console_messages returns an array of OpenStructs with the keys [:type, :message, :source, :line_number, :columnNumber]. It's unfortunate the difference in naming style for rows and columns.
The output from browser_logger still occurs when console_messages is used. Setting browser_logger to nildisablesconsole_messages as well (it's always empty). Instead, I used File.open(File::NULL, "w").
It would be nice to be able to act as more of a filter. Right now, I effectively suppress all messages during the test run, then print them out as a batch at the end. This removes the ability to see how they mix with other prints (such as those in my tests)
In our application, we have a bunch of junk messages from third-party components that we can't turn off.
Sample
For our Selenium tests, we have a bit of glue code to get the browser logs and clean the things we don't care about:
The Apparition documentation states that the way to control output from
console.*
statements is viabrowser_logger
, much the same as Poltergeist:Unfortunately, by being IO-based, it becomes difficult to perform any filtering. For example, the write call might include data unrelated to the target message or the target message might be split into multiple calls.
Examples
Would it be possible to transfer these browser messages in a more structured manner so that they are easier to work with?
The text was updated successfully, but these errors were encountered: