Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored testing #4

Merged
merged 5 commits into from
May 23, 2022
Merged

Refactored testing #4

merged 5 commits into from
May 23, 2022

Conversation

acsbendi
Copy link

@acsbendi acsbendi commented May 20, 2022

This will make testing a lot simpler as we don't need to modify the code of the adapter/Prebid.js.

Jira: KAI-3476

Here's the page I used to test this:

<html>

<head>
    <link rel="icon" type="image/png" href="/favicon.png">
    <script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
    <script src="http://localhost:63342/prebid-fork//build/dist/prebid.js"></script>
    <script>
        var div_1_sizes = [
            [300, 600],
            [300, 250],
            [320, 250],
            [300, 600]
        ];
        var PREBID_TIMEOUT = 1000;
        var FAILSAFE_TIMEOUT = 3000;

        var adUnits = [
            {
                code: '/19968336/header-bid-tag-0',
                mediaTypes: {
                    banner: {
                        sizes: div_1_sizes
                    }
                },
                bids: [{
                    bidder: 'kobler',
                    params: {
                        test: true
                    }
                }]
            }
        ];

        // ======== DO NOT EDIT BELOW THIS LINE =========== //
        var googletag = googletag || {};
        googletag.cmd = googletag.cmd || [];
        googletag.cmd.push(function() {
            googletag.pubads().disableInitialLoad();
        });

        var pbjs = pbjs || {};
        pbjs.que = pbjs.que || [];

        pbjs.que.push(function() {
            pbjs.addAdUnits(adUnits);
            pbjs.setConfig({
                "currency": {
                    "adServerCurrency": "NOK"
                },
                pageUrl: 'https://www.tv2.no/mening-og-analyse/14555348/'
            });
            pbjs.requestBids({
                bidsBackHandler: initAdserver,
                timeout: PREBID_TIMEOUT
            });
        });

        function initAdserver() {
            if (pbjs.initAdserverSet) return;
            pbjs.initAdserverSet = true;
            googletag.cmd.push(function() {
                pbjs.que.push(function() {
                    pbjs.setTargetingForGPTAsync();
                    googletag.pubads().refresh();
                });
            });
        }
        // in case PBJS doesn't load
        setTimeout(function() {
            initAdserver();
        }, FAILSAFE_TIMEOUT);

        googletag.cmd.push(function() {
            googletag.defineSlot('/19968336/header-bid-tag-0', div_1_sizes, 'div-1').addService(googletag.pubads());
            googletag.pubads().enableSingleRequest();
            googletag.enableServices();
        });

    </script>

</head>

<body>
<h2>Basic Prebid.js Example</h2>
<h5>Div-1</h5>
<div id='div-1'>
    <script type='text/javascript'>
        googletag.cmd.push(function() {
            googletag.display('div-1');
        });

    </script>
</div>

</body>

</html>

- Change the [`refererInfo` function](https://github.com/prebid/Prebid.js/blob/master/src/refererDetection.js) to return `'https://www.tv2.no/a/11734615'` as a [`referer`](https://github.com/prebid/Prebid.js/blob/caead3ccccc448e4cd09d074fd9f8833f56fe9b3/src/refererDetection.js#L169). This is necessary because Kobler only bids on recognized articles.
- Change the adapter's [`BIDDER_ENDPOINT`](https://github.com/prebid/Prebid.js/blob/master/modules/koblerBidAdapter.js#L8) to `'https://bid-service.dev.essrtb.com/bid/prebid_rtb_call'`. This endpoint belongs to the development server that is set up to always return a bid for the correct format size and page URL combination.
- Set the `test` parameter to `true`.
- Set config.pageUrl to `'https://www.tv2.no/mening-og-analyse/14555348/'`. This is necessary because Kobler only bids on recognized articles.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should clarify what this does and explain that this is just an example URL (I guess this won't work in a year for example, since we only bid on articles that are at most 1 year old)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll add more details. We can still make it work in 1 year, we just have to keep updating the date_dt field of the document in Solr in DEV and make sure our campaign (https://dev-app.kobler.no/campaigns/572) has enough budget and its CT matches the article.

@acsbendi acsbendi force-pushed the refactor-testing branch from 9cbe196 to 606aac3 Compare May 23, 2022 12:57
@acsbendi acsbendi merged commit cd458ec into master May 23, 2022
acsbendi pushed a commit that referenced this pull request Dec 6, 2024
* Flipp Bid Adapter: initial release

* Added flippBidAdapter

* OFF-372 Support DTX/Hero in flippBidAdapter (#2)

* support creativeType

* OFF-422 flippBidAdapter handle AdTypes

---------

Co-authored-by: Jairo Panduro <jpanduro@blackbird-lab.com>

* OFF-465 Add getUserKey logic to prebid.js adapter (#3)

* Support cookie sync and uid

* address pr feedback

* remove redundant check

* OFF-500 Support "startCompact" param for Prebid.JS #4

* set startCompact default value (prebid#5)

* fix docs

* use client bidding endpoint

* update unit testing endpoint

* OFF-876 [Prebid Adapter] Check userKey for empty string (prebid#6)

* add more checks to userKey

* update document

* add uuid format statement

* modify docs

* fix network id

* use compactHeight and standardHeight in customData (prebid#7)

* OFF-1455 [Prebid.js] height should use the compactHeight and standardHeight fields in decisions response (prebid#8)

* Flipp Bid Adapter: initial release

* Added flippBidAdapter

* OFF-372 Support DTX/Hero in flippBidAdapter (#2)

* support creativeType

* OFF-422 flippBidAdapter handle AdTypes

---------

Co-authored-by: Jairo Panduro <jpanduro@blackbird-lab.com>

* OFF-465 Add getUserKey logic to prebid.js adapter (#3)

* Support cookie sync and uid

* address pr feedback

* remove redundant check

* OFF-500 Support "startCompact" param for Prebid.JS #4

* set startCompact default value (prebid#5)

* fix docs

* use client bidding endpoint

* update unit testing endpoint

* OFF-876 [Prebid Adapter] Check userKey for empty string (prebid#6)

* add more checks to userKey

* update document

* add uuid format statement

* modify docs

* fix network id

* use compactHeight and standardHeight in customData

---------

Co-authored-by: Jairo Panduro <jpanduro@blackbird-lab.com>

* Update flippBidAdapter.js

* use compactHeight and standardHeight in customData (prebid#7)

* update docs

* fix unit test

---------

Co-authored-by: Jairo Panduro <jpanduro@blackbird-lab.com>
acsbendi pushed a commit that referenced this pull request Dec 6, 2024
* Kimberlite bid adapter (#1)

* initial: bid adapter

* styling

* Fix: lint (#2)

* Fix: lint (#4)

* review fixes (prebid#6)

* Change: filling request.ext.prebid section (prebid#7)

* Video support

* Fix: tests

* Adapter's version update

* No video defaults
acsbendi pushed a commit that referenced this pull request Dec 6, 2024
* Initial nativoBidAdapter document creation (js, md and spec)

* Fulling working prebid using nativoBidAdapter. Support for GDPR and CCPA in user syncs.

* Added defult size settings based on the largest ad unit. Added response body validation. Added consent to request url qs params.

* Changed bidder endpoint url

* Changed double quotes to single quotes.

* Reverted package-json.lock to remove modifications from PR

* Added optional bidder param 'url' so the ad server can force- match an existing placement

* Lint fix. Added space after if.

* Added new QS param to send various adUnit data to adapter endpopint

* Updated unit test for new QS param

* Added qs param to keep track of ad unit refreshes

* Updated bidMap key default value

* Updated refresh increment logic

* Refactored spread operator for IE11 support

* Updated isBidRequestValid check

* Refactored Object.enties to use Object.keys to fix CircleCI testing errors

* Updated bid mapping key creation to prioritize ad unit code over placementId

* Added filtering by ad, advertiser and campaign.

* Merged master

* Added more robust bidDataMap with multiple key access

* Deduped filer values

* Rolled back package.json

* Duped upstream/master's package.lock file ... not sure how it got changed in the first place

* Small refactor of filterData length check. Removed comparison with 0 since a length value of 0 is already falsy.

* Added bid sizes to request

* Fixed function name in spec. Added unit tests.

* Added priceFloor module support

* Added protection agains empty url parameter

* Changed ntv_url QS param to use referrer.location instead of referrer.page

* Removed testing 'only' flag

* Added ntv_url QS param value validation

* Added userId support

* Added unit tests, refactored for bugs

* Wrapped ajax in try/catch

* Added more unit testing

* Updated eid check for duplicate values. Removed error logging as we no longer need it.

* Removed spec test .only. Fixed unit tests that were breaking.

* Added Prebid version to nativo exchange request

* Removed unused bidder methods

* Added OpenRTB payload response. Changes requerst type to POST.

* Removed debug log

* Added/fixed tests

* Handle video mediaType

* Add built renderer files

* Fix no-inner-declarations linting error

* Handle native requests

* Add examples in Nativo readme

* Add 'mediaType' property to tests for compatibility with adapter code

* Remove data URI from VAST XML

* Fix 'no-unused-expressions' lint error

* Fix lint error 'curcly'

* Remove bidder name validation in 'isBidRequestValid' (#4)

* Add GPP consent string to req (prebid#5)

---------

Co-authored-by: Josh <jfledd@gmail.com>
Co-authored-by: Joshua Fledderjohn <jfledderjohn@nativo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants