Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .gherkin-lintrc

This file was deleted.

38 changes: 0 additions & 38 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,7 @@
const { defineConfig } = require('cypress');

const webpack = require('@cypress/webpack-preprocessor');
const preprocessor = require('@badeball/cypress-cucumber-preprocessor');

async function setupNodeEvents(on, config) {
// implement node event listeners here

await preprocessor.addCucumberPreprocessorPlugin(on, config);

on(
'file:preprocessor',
webpack({
webpackOptions: {
resolve: {
extensions: ['.js'],
},
module: {
rules: [
{
test: /\.feature$/,
use: [
{
loader: '@badeball/cypress-cucumber-preprocessor/webpack',
options: config,
},
],
},
],
},
},
}),
);

config = require('@bigbite/wp-cypress/lib/cypress-plugin')(on, config);
return config;
}

module.exports = defineConfig({
e2e: {
setupNodeEvents,
specPattern: 'cypress/**/*.feature',
watchForFileChanges: true,
baseUrl: 'http://localhost:3333',
},
Expand Down
8 changes: 8 additions & 0 deletions cypress/e2e/example.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

describe('no release notes found', () => {
it('some release notes are published', () => {
cy.visit('/wp-admin/admin.php?page=release-notes');
cy.get('article.release-note-single').should('exist');
cy.get('article.release-note-single h1.release-note-title').contains('Release not found!');
});
});
10 changes: 0 additions & 10 deletions cypress/e2e/example.feature

This file was deleted.

16 changes: 0 additions & 16 deletions cypress/e2e/example.js

This file was deleted.

42 changes: 42 additions & 0 deletions cypress/e2e/release-notes-creation.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
describe('release note creation', () => {
beforeEach(() => {
cy.intercept({ method: 'POST', url: `/wp-json/wp/v2/release-note/*` }).as('releasePublished')
})

it('an Administrator creates a new release note with provided updates', () => {
cy.visit("/wp-admin/edit.php?post_type=release-note")
cy.get(".page-title-action").contains("Add New").click()
cy.get(".wp-block-post-title").click().type("hello world")
cy.get(".is-root-container").within(() => {
cy.get("p.wp-block-paragraph").type("Overview text")
cy.get("ul").eq(0).within(() => {
cy.get("li").eq(0).type("list item #1{enter}")
cy.get("li").eq(1).type("list item #2")
});
cy.get("ul").eq(1).within(() => {
cy.get("li").eq(0).type("list item #1{enter}")
cy.get("li").eq(1).type("list item #2")
});
cy.get("ul").eq(2).within(() => {
cy.get("li").eq(0).type("list item #1{enter}")
cy.get("li").eq(1).type("list item #2")
});
});
cy.contains("button", "Release Note").click()
cy.contains("button", "Release Info").click()
cy.get(".components-input-control__container").type("1.0.0")

cy.contains("button", "Publish").click()
cy.get(".editor-post-publish-panel__header").within(() => {
cy.contains("button", "Publish").click()
});
cy.saveCurrentPost()
cy.wait("@releasePublished")
.its("response.statusCode")
.should("eq", 200)

cy.visit("wp-admin/admin.php?page=release-notes")
cy.get(".menupop.release-note").should("contain", "1.0.0")
cy.get(".release-note-version").should("contain", "1.0.0")
});
});
Loading