Skip to content

Commit

Permalink
Merge pull request #86 from lilt/3.x-development
Browse files Browse the repository at this point in the history
3.x development
  • Loading branch information
hadomskyi authored Mar 1, 2023
2 parents eb102cd + cd7a682 commit c0760c8
Show file tree
Hide file tree
Showing 16 changed files with 680 additions and 40 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,33 @@ on:
branches:
- "*"
jobs:
e2e:
e2e-instant:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run automation
working-directory: ./e2e
run: |
make up
make test
make test-instant
e2e-verified:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run automation
working-directory: ./e2e
run: |
make up
make test-verified
e2e-copy-source-text:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run automation
working-directory: ./e2e
run: |
make up
make test-copy-source-text
tests-php-72:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 3.4.3 - 2023-02-24
### Fixed
- Multilingual draft publishing issue
- Failed jobs aren't able to be deleted ([github issue](https://github.com/lilt/craft-lilt-plugin/issues/90))

## 3.4.2 - 2023-02-21
### Changed
- Retry logic for queues
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "lilt/craft-lilt-plugin",
"description": "The Lilt plugin makes it easy for you to send content to Lilt for translation right from within Craft CMS.",
"type": "craft-plugin",
"version": "3.4.2",
"version": "3.4.3",
"keywords": [
"craft",
"cms",
Expand Down
24 changes: 24 additions & 0 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,27 @@ test:
--env-file .env.test \
--entrypoint=cypress \
cypress/included:12.2.0 run --headless --config-file /e2e/cypress.config.js --record false

test-instant:
docker run -u root -t -v ${PWD}:/e2e -w /e2e --env CYPRESS_CACHE_FOLDER=${CYPRESS_CACHE_FOLDER} node:18.12.1 npm install
docker run -u root -t -v ${PWD}:/e2e -w /e2e --env CYPRESS_CACHE_FOLDER=${CYPRESS_CACHE_FOLDER} \
--network e2e-network \
--env-file .env.test \
--entrypoint=cypress \
cypress/included:12.2.0 run --headless --config-file /e2e/cypress.config.js --spec cypress/e2e/jobs/instant/*.js --record false

test-verified:
docker run -u root -t -v ${PWD}:/e2e -w /e2e --env CYPRESS_CACHE_FOLDER=${CYPRESS_CACHE_FOLDER} node:18.12.1 npm install
docker run -u root -t -v ${PWD}:/e2e -w /e2e --env CYPRESS_CACHE_FOLDER=${CYPRESS_CACHE_FOLDER} \
--network e2e-network \
--env-file .env.test \
--entrypoint=cypress \
cypress/included:12.2.0 run --headless --config-file /e2e/cypress.config.js --spec cypress/e2e/jobs/verified/*.js --record false

test-copy-source-text:
docker run -u root -t -v ${PWD}:/e2e -w /e2e --env CYPRESS_CACHE_FOLDER=${CYPRESS_CACHE_FOLDER} node:18.12.1 npm install
docker run -u root -t -v ${PWD}:/e2e -w /e2e --env CYPRESS_CACHE_FOLDER=${CYPRESS_CACHE_FOLDER} \
--network e2e-network \
--env-file .env.test \
--entrypoint=cypress \
cypress/included:12.2.0 run --headless --config-file /e2e/cypress.config.js --spec cypress/e2e/jobs/copy-source-text-flow/*.js --record false
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
const {generateJobData} = require('../../../support/job/generator.js');

describe(
'[Verified] Success path for job with multiple target languages with bulk publishing',
() => {
const entryLabel = 'The Future of Augmented Reality';
const entryId = 24;

it('with copy slug disabled & enable after publish disabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: false,
enableAfterPublish: false,
languages: ['de', 'es', 'uk'],
batchPublishing: true,
});
});

it('with copy slug disabled & enable after publish enabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: false,
enableAfterPublish: true,
languages: ['de', 'es', 'uk'],
batchPublishing: true,
});
});

it('with copy slug enabled & enable after publish disabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: true,
enableAfterPublish: false,
languages: ['de', 'es', 'uk'],
batchPublishing: true,
});
});

it('with copy slug enabled & enable after publish enabled', () => {
const {jobTitle, slug} = generateJobData();

cy.log(`Job title: ${jobTitle}`);
cy.log(`Slug: ${slug}`);

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: true,
enableAfterPublish: true,
languages: ['de', 'es', 'uk'],
batchPublishing: true,
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
const {generateJobData} = require('../../../support/job/generator.js');

describe(
'[Verified] Success path for job with multiple target languages with single publishing',
() => {
const entryLabel = 'The Future of Augmented Reality';
const entryId = 24;

it('with copy slug disabled & enable after publish disabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: false,
enableAfterPublish: false,
languages: ['de', 'es', 'uk'],
batchPublishing: false,
});
});

it('with copy slug disabled & enable after publish enabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: false,
enableAfterPublish: true,
languages: ['de', 'es', 'uk'],
batchPublishing: false,
});
});

it('with copy slug enabled & enable after publish disabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: true,
enableAfterPublish: false,
languages: ['de', 'es', 'uk'],
batchPublishing: false,
});
});

it('with copy slug enabled & enable after publish enabled', () => {
const {jobTitle, slug} = generateJobData();

cy.log(`Job title: ${jobTitle}`);
cy.log(`Slug: ${slug}`);

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: true,
enableAfterPublish: true,
languages: ['de', 'es', 'uk'],
batchPublishing: false,
});
});
});
67 changes: 67 additions & 0 deletions e2e/cypress/e2e/jobs/verified/success-path-single.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
const {generateJobData} = require('../../../support/job/generator.js');

describe(
'[Verified] Success path for job with single target language',
() => {
const entryLabel = 'The Future of Augmented Reality';
const entryId = 24;

it('with copy slug disabled & enable after publish disabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: false,
enableAfterPublish: false,
languages: ["de"],
})
});

it('with copy slug disabled & enable after publish enabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: false,
enableAfterPublish: true,
languages: ["de"]
})
});

it('with copy slug enabled & enable after publish disabled', () => {
const {jobTitle, slug} = generateJobData();

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: true,
enableAfterPublish: false,
languages: ["de"]
})
});

it('with copy slug enabled & enable after publish enabled', () => {
const {jobTitle, slug} = generateJobData();

cy.log(`Job title: ${jobTitle}`)
cy.log(`Slug: ${slug}`)

cy.verifiedFlow({
slug,
entryLabel,
jobTitle,
entryId,
copySlug: true,
enableAfterPublish: true,
languages: ["de"]
})
});
});
16 changes: 13 additions & 3 deletions e2e/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,10 @@ Cypress.Commands.add('publishTranslation', (jobTitle, language) => {
cy.get('#translations-publish-action').click();
});

cy.wait(10000); //delay for publishing
cy.waitForJobStatus('complete');
cy.
get('#notifications .notification.notice').
invoke('text').
should('contain', 'Translation(s) published');
});

/**
Expand Down Expand Up @@ -391,7 +393,11 @@ Cypress.Commands.add('publishTranslations', (jobTitle, languages) => {

cy.get('#translations-publish-action').click();

cy.wait(10000); //delay for publishing
cy.
get('#notifications .notification.notice').
invoke('text').
should('contain', 'Translation(s) published');

cy.waitForJobStatus('complete');
});

Expand All @@ -413,7 +419,11 @@ Cypress.Commands.add('publishJob',
cy.assertDraftSlugValue(copySlug, slug, language);

cy.publishTranslation(jobTitle, language);
}

cy.waitForJobStatus('complete');

for (const language of languages) {
cy.assertAfterPublish(copySlug, slug, entryId, language,
enableAfterPublish);
}
Expand Down
1 change: 1 addition & 0 deletions e2e/cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './commands'
import './flow/instant'
import './flow/verified'

beforeEach(() => {
cy.wrap(Cypress.session.clearAllSavedSessions())
Expand Down
Loading

0 comments on commit c0760c8

Please sign in to comment.