Socket
Socket
Sign inDemoInstall

@devoxa/cypress-page-performance

Package Overview
Dependencies
2
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @devoxa/cypress-page-performance

Save page performance metrics to disk during Cypress runs


Version published
Maintainers
1
Created

Readme

Source

:no_entry: DEPRECATED :no_entry:

This package has been archived and is no longer maintained. While we will not provide any updates or support, the code is still available for reference. If you need this package for your project, we encourage you to fork & republish the code following the license terms.


cypress-page-performance

Save page performance metrics to disk during Cypress runs.

Package Version Build Status

InstallationUsageAdditional helpersContributorsLicense


Installation

  1. Install the package
yarn add --dev @devoxa/cypress-page-performance
  1. Import the command in cypress/support/commands.ts:
import { addSavePagePerformanceMetricsCommand } from '@devoxa/cypress-page-performance/command'
addSavePagePerformanceMetricsCommand()
  1. Import the plugin in cypress/plugins/index.ts:
import { addSavePagePerformanceMetricsPlugin } from '@devoxa/cypress-page-performance/plugin'

export default (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => {
  addSavePagePerformanceMetricsPlugin(on, config)

  // You can also optionally add an additional options object:
  // addSavePagePerformanceMetricsPlugin(on, config, options)

  return config
}

Additional available options:

  • fileName: The name of the file that the page performance metrics are saved into, defaults to page-performance-metrics.json

Usage

describe('SignInPage', () => {
  it('renders the page successfully', () => {
    cy.visit('/sign-in')

    cy.savePagePerformanceMetrics('SignInPage')
  })
})

After running Cypress, the plugin will output a JSON file with an array of page performance entries in the root directory.

[
  {
    "label": "SignInPage",
    "encodedBodySize": 205048,
    "resourceLoadFinish": 156.32,
    "nextjsHydrationFinish": 137.64
  }
]

Additional helpers

The package also includes an additional helper that formats the output JSON as a markdown table using Github flavoured markdown, encoded for use in Github actions.

./node_modules/.bin/format-page-performance-metrics-as-gfm

Contributors

Thanks goes to these wonderful people (emoji key):


David Reeß

💻 📖 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT

FAQs

Last updated on 28 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc