Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Dec 24, 2023
1 parent 0e41d8c commit 76c0393
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,11 @@ module.exports = (config) => {

if (stepObj.status === 'failed' && step.err) {
await sendLogToRP({ tempId: stepObj.tempId, level: 'ERROR', message: `[FAILED STEP] - ${(step.err.stack ? step.err.stack : JSON.stringify(step.err))}` });
await sendLogToRP({
tempId: stepObj.tempId, level: 'debug', message: 'Last seen screenshot', screenshotData: await attachScreenshot(`${clearString(test.testTitle)}.failed.png`),
});
} else if (stepObj.status === 'failed' && step.helper.currentRunningTest.err) {
await sendLogToRP({ tempId: stepObj.tempId, level: 'ERROR', message: `[FAILED STEP] - ${step.helper.currentRunningTest.err}` });
}

if (helper) {
await sendLogToRP({
tempId: stepObj.tempId, level: 'debug', message: 'Last seen screenshot', screenshotData: await attachScreenshot(`${clearString(test.testTitle)}.failed.png`),
});
Expand Down
9 changes: 3 additions & 6 deletions test/acceptance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ describe('RP Plugin - Codeceptjs Integration', () => {
describe('Passed test', () => {
it.skip('should push data to rp', (done) => {
exec(`${runner} --grep @pass -c ${configFilePath} --verbose`, (error, stdout, stderr) => {
expect(stdout).to.include('Start launch with tempId');
expect(stdout).to.include("type: 'TEST'");
expect(stdout).to.include("type: 'STEP'");
expect(stdout).to.include('Success start launch with tempId');
expect(stdout).to.include('OK | 1 passed ');
done();
});
Expand All @@ -20,9 +18,8 @@ describe('RP Plugin - Codeceptjs Integration', () => {
describe('Failed test', () => {
it('should push data to rp', (done) => {
exec(`${runner} --grep @fail -c ${configFilePath} --verbose`, (error, stdout, stderr) => {
expect(stdout).to.include('Start launch with tempId');
expect(stdout).to.include("type: 'TEST'");
expect(stdout).to.include("type: 'STEP'");
console.log(stdout)
expect(stdout).to.include('Success start launch with tempId');
expect(stdout).to.include('FAIL | 0 passed, 1 failed');
done();
});
Expand Down
8 changes: 2 additions & 6 deletions test/bdd_acceptance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ describe('RP Plugin - Codeceptjs Integration - BDD Feature', () => {
describe('Passed test', () => {
it('should push data to rp', (done) => {
exec(`${runner} --grep @pass -c ${configFilePath} --verbose`, (error, stdout, stderr) => {
expect(stdout).to.include('Start launch with tempId');
expect(stdout).to.include("type: 'TEST'");
expect(stdout).to.include("type: 'STEP'");
expect(stdout).to.include('Success start launch with tempId');
expect(stdout).to.include('OK | 1 passed ');
done();
});
Expand All @@ -20,9 +18,7 @@ describe('RP Plugin - Codeceptjs Integration - BDD Feature', () => {
describe('Failed test', () => {
it('should push data to rp', (done) => {
exec(`${runner} --grep @fail -c ${configFilePath} --verbose`, (error, stdout, stderr) => {
expect(stdout).to.include('Start launch with tempId');
expect(stdout).to.include("type: 'TEST'");
expect(stdout).to.include("type: 'STEP'");
expect(stdout).to.include('Success start launch with tempId');
expect(stdout).to.include('FAIL | 0 passed, 1 failed');
done();
});
Expand Down

0 comments on commit 76c0393

Please sign in to comment.