Skip to content

Commit

Permalink
create handleAttachment method to use in TestCafe for the 6242 issue (#…
Browse files Browse the repository at this point in the history
…2703)

* handle attachment

* fix server tests
  • Loading branch information
AlexKamaev committed Oct 22, 2021
1 parent 890d06c commit 8e616df
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/request-pipeline/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ export default class RequestPipelineContext {
if (isFileDownload)
this.session.handleFileDownload();

if (isAttachment)
this.session.handleAttachment();

This comment has been minimized.

Copy link
@luphoria

luphoria Oct 31, 2021

yes.. this appears to not work at all? and hammerhead now completely crashes on this line: #2708


this.contentInfo = {
charset,
requireProcessing,
Expand Down
1 change: 1 addition & 0 deletions src/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ export default abstract class Session extends EventEmitter {
abstract async getIframePayloadScript (iframeWithoutSrc: boolean): Promise<string>;
abstract async getPayloadScript (): Promise<string>;
abstract handleFileDownload (): void;
abstract handleAttachment (): void;
abstract handlePageError (ctx: RequestPipelineContext, err: string): void;
abstract getAuthCredentials (): Credentials;

Expand Down
1 change: 1 addition & 0 deletions test/server/charset-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ describe('Content charset', () => {

session = new Session();
session.getAuthCredentials = () => null;
session.handleAttachment = () => void 0;
session.id = 'sessionId';

proxy = new Proxy('127.0.0.1', 1836, 1837);
Expand Down
1 change: 1 addition & 0 deletions test/server/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ exports.createSession = function (parameters) {

session.getAuthCredentials = () => null;
session.handleFileDownload = () => void 0;
session.handleAttachment = () => void 0;

return session;
};
Expand Down
1 change: 1 addition & 0 deletions test/server/external-proxy-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('External proxy', () => {

session.getAuthCredentials = () => null;
session.handleFileDownload = () => void 0;
session.handleAttachment = () => void 0;

proxy = new Proxy('127.0.0.1', 1836, 1837);

Expand Down

0 comments on commit 8e616df

Please sign in to comment.