Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
A library for helping you organise your JavaScript test automation code, inspired by the screenplay pattern.
What's lovely about screenplay, as opposed to other patterns for organising automation code like page objects, is that you're building abstractions around behaviour, rather than solution implementation. We think you're going to like it.
Copared to other screenplay implementations we've seen, what's unique about Feynman is that you can define multiple perspectives that allow you to run the same tasks against your application in different ways.
More on that later.
We're going to assume you know little or nothing about the screenplay pattern and explain this from the ground up. Let's start with an example.
const { actor } = require('feynman')
const dave = await actor('dave')
await dave.attemptsTo(PostMessageInSlack)
What's going on here?
First, we call the actor
method to get hold of an Actor who we've given the label "dave". It doesn't matter what we
call our actor in this example, but you'll see why it's useful later on.
Next, we ask Dave to attempt an Action, PostMessageInSlack
.
In order to make this code work, we'll need to define that action, as well as giving dave
an Ability that lets our action post messages in Slack.
First we create the action:
const channel = 'YOURCHANNEL' // should look like CFCJMB2K0
const PostMessageInSlack = ({ slack }) => slack.chat.postMessage({ channel, text: "Hello world!" })
So our PostMessageInSlack
action is defined as a function that takes a slack
named parameter, representing the Slack web client API, and calls the API to post a message.
How do we give dave
this ability?
(async () => {
const { actor, abilities } = require('feynman')
const { WebClient } = require('@slack/client')
const token = process.env.SLACK_TOKEN
const slack = new WebClient(token)
abilities({ slack })
const channel = 'YOURCHANNEL' // should look like CFCJMB2K0
const PostMessageInSlack = ({ slack }) => slack.chat.postMessage({ channel, text: "Hello world!" })
const dave = await actor('dave')
await dave.attemptsTo(PostMessageInSlack)
})()
That's the fundamentals of using Feynman. Read on to learn more about:
FAQs
A screenplay pattern library for javascript
The npm package feynman receives a total of 1 weekly downloads. As such, feynman popularity was classified as not popular.
We found that feynman demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.