teleren/devto huggingface dataset:
Set up Cucumber reports with screenshots
Published: 2023-12-05 19:04:01

### Maven setup Surefire plugin <a name="surefire"></a>

Below pom.xml configuration will generate a html and json report. The reports will have a screenshot when tests fail.

```xml
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <properties>
                        <configurationParameters>
                            cucumber.plugin=pretty,html:target/site/TestRun.html,json:target/site/TestRun.json
                            cucumber.publish.quiet=true
                            cucumber.publish.enabled=false
                        </configurationParameters>
                    </properties>
                </configuration>
            </plugin>
        </plugins>
    </build>
```


### Cucumber After method <a name="screenshot_config"></a>

```java
    @After
    public void afterEach(Scenario scenario){
        if(scenario.isFailed()){
            final byte[] screenshot = page.screenshot(new Page.ScreenshotOptions()
                    .setPath(Paths.get("screenshot.png")));
            scenario.attach(screenshot, "image/png", scenario.getName());
        }
        browserContext.close();
    }
```
Here, we are checking if the scenario is failed and if so, it will attach a screenshot.

### Intentionally create test failure <a name="test_failure"></a>

```cucumber
  Scenario Outline: User is able to request a Demo
    Given User navigates to PHPTRAVELS Demo Page
    When User fills in Demo Request Form <firstName>, <lastName>, <businessName>, <email>
    When User calculates and fills wrong result
    When User clicks submit
    Then Verify thank you text
    Examples:
      | firstName | lastName | businessName | email               |
      | "ABC"     | "DEF"    | "Main Inc."  | "whatever@main.com" |
```

Here on the register.feature file, we intentionally filled out the wrong result causing the test to fail. 

run: mvn clean install

check report path as noted in pom.xml: target/site/TestRun.html


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brhpyhadg1q3jmk9woxa.JPG)

As always code is on available on [Github](https://github.com/terencenmnpan/TestAutomation/tree/main/PlaywrightCucumberExample)
What happens in Vegas, stays in Vegas- But not for AWS
Tags: aws, amazon, communitybuilders
Published: 2023-12-05 18:54:03

So here is the quickest update of announcements at the Re-invent 23 event.

**1. [Amazon Q](https://youtu.be/y6P-3CPj7CQ)**
Amazon Q is a new type of generative AI assistant specifically for work. It can be tailored to your business and is with security and privacy in mind. 

**2. Expanded choice of models in Amazon Bedrock**
With Amazon Bedrock, customers can drive rapid innovation with the latest versions of foundation models. Customers have even more choice of models to build and scale generative AI applications. This includes additions from Anthropic, Cohere, Meta, and Stability AI, as well as new models in the Amazon Titan family.

[**3. 5 new Amazon SageMaker capabilities**](https://aws.amazon.com/pm/sagemaker/?gclid=Cj0KCQiA35urBhDCARIsAOU7QwnGw5DiRil6v9vEjSW9GTsiQqtW_qEMXzN7EtrTNOvtVp-d4rMzzUsaAp2dEALw_wcB&trk=b6c2fafb-22b1-4a97-a2f7-7e4ab2c7aa28&sc_channel=ps&ef_id=Cj0KCQiA35urBhDCARIsAOU7QwnGw5DiRil6v9vEjSW9GTsiQqtW_qEMXzN7EtrTNOvtVp-d4rMzzUsaAp2dEALw_wcB:G:s&s_kwcid=AL!4422!3!651751060692!e!!g!!amazon%20sagemaker!19852662230!145019225977)
Amazon SageMaker is a fully managed service that brings together a broad set of tools to enable high-performance, low-cost machine learning for any use case. Five new capabilities will make it even easier for customers to build, train, and deploy models for generative AI.

**4. AWS serverless innovations**
Three new AWS serverless innovations for Amazon Aurora, Amazon Redshift, and Amazon ElastiCache build on the work AWS has been doing ever since the first service, Amazon S3: Amazon Simple Storage Service, was launched. The new offerings are aimed to help customers analyze and manage data at any scale, while dramatically simplifying their operations

**5. Amazon S3 Express One Zone**
Amazon S3 is one of the most popular cloud object storage services, holding more than 350 trillion “objects,” or pieces of data, and averaging more than 100 million requests for data a second. Amazon S3 Express One Zone is a new purpose-built storage class for running applications that require extremely fast data access, to achieve the highest possible efficiency.
What’s new in AWS Amplify: Features to Build and Scale Fullstack Apps
Tags: javascript, aws, webdev, typescript
Published: 2023-12-05 18:43:53

AWS Amplify has rolled out several new capabilities for developers building fullstack applications in the last few weeks - I want to share a summary of them. These updates deliver on highly requested community features to simplify development workflows. The embedded tweets all have videos demoing the new features. Let's dive in!

## [New Code-First Developer Experience](https://aws.amazon.com/blogs/mobile/introducing-amplify-gen2/)

Amplify unveiled a code-first way to develop fullstack apps. Instead of a CLI-driven workflow, you can author application requirements in TypeScript. This includes data models, business logic, and authorization rules. Amplify handles provisioning cloud resources based on your code. This new generation of Amplify is also fully built with the AWS CDK, so extensibility is built in. There’s a lot of new features with this one - I’d highly encourage 
you to read the full launch blog!

{% twitter 1726996779118338071 %}

## [Server-Side Rendering Deployment Spec](https://aws.amazon.com/blogs/mobile/introducing-support-for-hosting-any-ssr-app-on-aws-amplify-hosting/)

A new spec opens up fully managed SSR hosting on Amplify to frameworks like Nuxt, SvelteKit, Astro, and Express. Adhere to conventions for compute, images, routing, and assets to deploy performant SSR apps.

{% twitter 1726661768779268449 %}

## [v6 of the Amplify JavaScript library](https://aws.amazon.com/blogs/mobile/amplify-javascript-v6/)

Version 6 of the Amplify JS Library brings improvements like smaller bundle sizes, better TypeScript support, and improved Next.js support.

{% twitter 1724831823023263887 %}

## [Wildcard Subdomains](https://aws.amazon.com/blogs/mobile/wildcard-subdomains-for-multi-tenant-apps-on-aws-amplify-hosting/)

Amplify Hosting now allows wildcard subdomains when using custom domains. This unlocks dynamic, per-customer subdomains for SaaS and multi-tenant-like platforms. You can onboard users with unique subdomains like [customer1.myapp.com](http://customer1.myapp.com/) while routing traffic behind the scenes.

{% twitter 1725212171821359540 %}

## [Docs,  Custom Auth, UI updates, and More](https://aws.amazon.com/blogs/mobile/6-new-aws-amplify-launches-to-make-frontend-development-easier/)

Other launches include custom auth with Amazon Cognito, social login for React Native, Next.js 14 compatibility, upgraded docs, and new UI components.

Together these updates speed up building fullstack applications on AWS. We’d love to hear your feedback as you build! To learn more, visit our [docs site](https://docs.amplify.aws/)!
What software supports RAR, ZIP, and 7zip on Mac?
Tags: rar
Published: 2023-12-05 18:39:12

What is a RAR file? RAR is data that stores one or more compressed files. Rar files are usually used by companies to compress their files to be smaller, thus saving disk space.
Therefore, let's release one of the most convenient and best [rar extractor for mac](https://ftp-mac.com/how-to-open-rar-on-mac/) - Commander One.

Commander One is a pretty great and lightweight tool to handle all your archive files and easily manage all your data. It offers a two-pane interface to extract RAR files on one screen and perform other tasks on the other.
HIRE A HACKER TO RECOVER STOLEN BITCOINS
Tags: webdev
Published: 2023-12-05 18:35:03

Hi Folks... My name is Carl Benedikt Frey, I'm a Swedish-German economist and economic historian. Also the Dieter Schwarz Associate Professor of AI & Work at the Oxford Internet Institute. 
I want to quickly tell you all about an Authorized company that can help you recover your lost cryptocurrency. Omega Recovery Specialist Crypto project is a shared intelligence and asset tracing service dedicated to victims of cybercrimes and companies related to asset recovery. Their goal is to help victims of bitcoin and cryptocurrency scam/fraud recover their digital funds from scammers operating offshore. I recommend it to anyone who has fallen victim to a crypto scam.
GET FREE HIGH DA ARTICLES BACKLINKS AND SUBMIT FREE YOUR ARTICLE ON THIS WEBSITE
Tags: javascript, beginners, react, programming
Published: 2023-12-05 18:33:10


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6jzg1j3v66d691euphmo.png)
We are always looking for high-quality content to share with our readers. If you have an article that you think would be a good fit for our website “**_[Guest Blog Post and Free Guest Posting Websites](http://freearticleposts.com/)_**”, we encourage you to submit it for consideration.


**What We Look For We are looking for articles that are:**

1.Original and well-written
2.Informative and engaging
3.Relevant to our website’s audience
4.Well-researched and accurate
5.Free of grammatical errors and typos

**Submission Guidelines**

Please submit your article as a Microsoft Word document or PDF file. Please also include a brief author bio and a headshot photo.

**How to Submit**
You can Submit to Direct your articles click on **_[Free High Quality Link Building](https://freearticleposts.com/)_** Free of Cost,

**Review Process**
All articles will be reviewed by our editorial team. We will notify you of our decision within two weeks of submission.
Publication

If your article is selected for publication, we will work with you to edit and finalize it. We will also promote your article on our website and social media channels.
Thank you for your interest in submitting to our website. We look forward to reading your work!
[http://freearticleposts.com/](http://freearticleposts.com/)
Read other users orders via CDN Caching - New vulnerability in SAP Commerce (CVE-2023-37486)
Tags: security, sap, cybersecurity
Published: 2023-12-05 18:32:02

This post will explain the process behind finding a security vulnerability in SAP Commerce (E-Commerce framework that many major shops are using) that allows to view orders of other users (including addresses, prices and possible other personal information). The finding was reported to SAP and fixed in the latest patch release. 

So firstly: If you have your own SAP Commerce instance, be sure to update to Version 2205.14 or higher (on prem) or Version 2211.9 (in cloud).


## Details on the vulnerability

SAP Commerce has a REST API to access various data, specially used for the SAP Composable Storefront (aka Spartacus - the Angular Frontend for SAP Commerce). One of the endpoints allows fetching all orders of the users. The endpoint is correctly secured to only be able to fetch the own orders. But let's take a look at a response:

```
GET https://<sap-commerce-server>/occ/v2/<some-base-site>/users/current/orders
> HTTP 200 OK
> cache-control: public, max-age=120
> cf-cache-status: HIT
```

The caching header of the response is very problematic if a CDN like Cloudflare is used. Because the response will be stored inside the CDN and shared across multiple users. So users can see other users orders, even as the endpoint is secured correctly, just by abusing the shared caching layer. The header is set like this in the Spring Controller:

```
@Secured("...")
@CacheControl(directive = CacheControlDirective.PUBLIC, maxAge = 120)
@RequestMapping(value = "/users/{userId}/orders", method = RequestMethod.GET)
public OrderHistoryListWsDTO getUserOrderHistory(...) {
    // validation code to check permissions
    // code to handle the request
}
```

The important part is the CacheControl annotation, which controls the response cache header and causes the problem. Private or None would be safe values here.


## How can this vulnerability be used?

The usage of this vulnerability is quite simple: An attacker can fetch the REST endpoint above over and over and hope, that some real user has fetched the endpoint less than 120 seconds ago. This is the time that a response will be cached. The attacker does not even need a login, he can request the endpoint without authentication, which makes the detection even simpler: If the response is a HTTP Status 200, it is likely a cached response from someone else.


## How can I protect myself?

If you use SAP Commerce, update to the latest patchlevel. As a quickfix, the response can be manually excluded from Caching in the shared cache like Cloudflare. See also the SAP security note for more information: https://me.sap.com/notes/3341934


## What can be learned?

Caching Headers are also relevant for security. Be sure that a resource is really public if the Cache-Control header is set to public. If you have any API endpoint returning personal data, make sure to never set the "public" cache control header, always set it to "private" or "none".
find the pivot integer
Tags: java
Published: 2023-12-05 18:07:38

> Given a positive integer n, find the pivot integer x such that:

> - The sum of all elements between 1 and x inclusively equals the sum of all elements between x and n inclusively.

> Return the pivot integer x. If no such integer exists, return -1. It is guaranteed that there will be at most one pivot index for the given input.

Solution
```java
class Solution {
    public int pivotInteger(int n) {
        if(n==1) return 1;
        for (int i = n - 1; i > 0; i--) {
            if (((n * (n + 1)) / 2) - ((i * (i - 1)) / 2) == (i * (i + 1)) / 2)
                return i;
        }

        return -1;
    }
}
```
reference:
https://leetcode.com/problems/find-the-pivot-integer/
https://math.stackexchange.com/a/2713667/1053103
6 Figma Portfolio Designs That Are Free to Customize!
Published: 2023-12-05 17:59:37



## Introduction:

Hey Dev.to community! 👋 Are you thinking about making your own website but not sure where to start? No worries! In this post, I want to show you six fantastic web developers Figma portfolio  designs


## figma
Before we embark on this design-filled journey, let's take a moment to appreciate the power of Figma. This incredible tool has revolutionized the way we design user interfaces, making it easier than ever to create visually appealing and interactive prototypes. With Figma, the possibilities are endless, and these six portfolio websites are a testament to that.

## 1.

## ✅✅https://www.figma.com/community/file/1225758714111104710 ✅✅


![Figma Portfolio Designs 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xpv368zntgs06q5r1lxr.png)


## 2.
##  ✅✅ https://www.figma.com/community/file/1185122580534161003 ✅✅


![Figma Portfolio Designs 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2twzo196uc3y2do61sf.png)

## 3.
## ✅✅  https://www.figma.com/community/file/1203440275430859222 ✅✅


![Figma Portfolio Designs 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9hat22xkvo2h7wg107z.png)


## 4. 
## ✅✅ https://www.figma.com/community/file/1174142802218062054 ✅✅


![Figma Portfolio Designs 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dar0m6ini5820oj9040m.png)

## 5.
##  ✅✅ https://www.figma.com/community/file/1209765833530090686 ✅✅

![Figma Portfolio Designs 5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6jpwnrfhzwgz2t0u5sm.png)

## 6. 
## ✅✅ https://www.figma.com/community/file/1144519064091466465
✅✅

![Figma Portfolio Designs 6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4oz8gwmj0ptl1ccd3d2s.png)

 that will make your jaw drop and inspire your own creative endeavors. Remember, your portfolio website is your digital storefront, 

## Conclusion:

So, there you have it, folks! Six Figma portfolio website designs
 before you begin building your web developer portfolio, so make it count. Use Figma to unleash your creativity and showcase your work in a way that truly represents your unique style and design sensibilities. Let the creativity of others inspire and guide you as you create a space that truly represents you.

## Feel free to check out my own portfolio if you're interested!
✅✅ https://sufianmustafa.com/ ✅✅


![Sufian mustafa portfolio website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i7d7w1j5umyj8hr1nm0j.png)

## It's your turn
Feel free to drop your portfolio link in the comments 💬 below 👇🏽 if you think your portfolio is unique. It's a great opportunity to get feedback not just from me but also from fellow developers. Let's celebrate creativity together! 🤝🤝

Thanks For Reading
Give it a hearty 💖 if u find it useful! Happy coding! 🚀
DP-203: Data Engineering on Microsoft Azure - Study Guide
Published: 2023-12-05 17:41:27

[Exam link](https://learn.microsoft.com/en-us/credentials/certifications/exams/dp-203/)
[Microsoft's official study guide](https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/dp-203#skills-measured-as-of-november-2-2023)

**Skills Measured**

- Design and implement data storage (15-20%)
- Develop data processing (40-45%)
- Secure, monitor, and optimize data storage and data processing (30-35%)

**Design and implement data storage (15-20%)**

- [Implement a partition strategy](https://dev.to/aidutcher/dp-203-study-guide-implement-a-partition-strategy-4fkj)
- [Design and implement the data exploration layer](https://dev.to/aidutcher/dp-203-study-guide-design-and-implement-the-data-exploration-layer-40pl)

**Develop data processing (40-45%)**

- [Ingest and transform data](https://dev.to/aidutcher/dp-203-study-guide-ingest-and-transform-data-108a)
- [Develop a batch processing solution](https://dev.to/aidutcher/dp-203-study-guide-develop-a-batch-processing-solution-4ehi)
- [Develop a stream processing solution](https://dev.to/aidutcher/dp-203-study-guide-develop-a-stream-processing-solution-3h26)
- [Manage batches and pipelines](https://dev.to/aidutcher/dp-203-study-guide-manage-batches-and-pipelines-3e66)

**Secure, monitor, and optimize data storage and data processing (30-35%)**

- [Implement data security](https://dev.to/aidutcher/dp-203-study-guide-implement-data-security-24pa)
- [Monitor data storage and data processing](https://dev.to/aidutcher/dp-203-study-guide-monitor-data-storage-and-data-processing-44no)
- [Optimize and troubleshoot data storage and data processing](https://dev.to/aidutcher/dp-203-study-guide-optimize-and-troubleshoot-data-storage-and-data-processing-2hbj)
Day 2: Factorial calculator app using Flutter
Tags: flutter, beginners, programming
Published: 2023-12-05 17:36:35

Hey there!

🚀 Big news! I've just wrapped up my second Flutter project—a factorial calculator app. It might be simple, but it's a solid step forward! This app computes factorials from user inputs, handling non-numeric entries and negatives flawlessly. Excited to keep pushing the boundaries with

Here is the project [link](https://github.com/api00/ongoing_app_development_learning)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cnwuunz28383tz7lxq0r.png)ingInProgress
JavaScript - Fundamentals
Published: 2023-12-05 17:02:41

- **Ctrl+Shift+J** - > To open inspect in Chrome.
- Biggest release to the language ever -> ES/2015 (ES -> EcmaScript).

NULL-> it's type is null but javascript prints it's type as an object which is a bug but is not changed for legacy reasons.

A particular variable when declared is by default string.

**_<u>Type Coercion</u>_** 

Basically how js treats '+' operator as a concatenation when it comes to string and not addition and how other mathematical operations preserve their natural nature.

To necessarily take user input as a certain data type -> use let fav = data_type(prompt());


```
console.log(`Hi ${1990-1000} years old`);
```

Here JS expects an expression instead of a statement in ${}

**_<u>/New</u>_**

"new" keyword actually means it will create a new object everytime even if it calls a constructor function with global scope (i.e. not inside an object)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkjfzo9qvz8w9oad8cl6.png)

**_<u>This Keyword</u>_**

https://www.freecodecamp.org/news/javascript-this-keyword-binding-rules/


**_<u>Null V/S Undefined</u>_**

**Undefined**
1. When a variable is declared but not initialized, or when a function does not return a value, the variable or the function’s result is **undefined**.
2. Accessing an object property or array element that does not exist also results in **undeclared**.
3. It is a primitive value.

```
let x; // variable declared but not initialized
console.log(x); // Output: undefined
 
function doSomething() {
  // no return statement, so the function returns undefined
}
console.log(doSomething()); // Output: undefined
 
let obj = {};
console.log(obj.property); // Output: undefined
```
**Output**
undefined
undefined
undefined

**Null**

1. It is a deliberate assignment that represents the absence of any object value.
2. It is often used to explicitly indicate that a variable or object property should have no value or no reference to any object.
3. It is also a primitive value.



**_<u>Function Call in JS</u>_**
So the entire flow goes like this:

For each loop of the event loop, one task is completed out of the callback queue.
Once that task is complete, the event loop visits the job queue. It completes all the micro tasks in the job queue before it looks into the next thing.
If both the queues got entries at the same point in time, the job queue gets preference over the callback queue.
Mac terminal loading animation using css
Tags: freecodez, react, html, blog
Published: 2023-12-05 16:45:57

Hey there, You are most welcome to this article. I hope you will enjoy this article. If you like this article then please share this article with your friends and colleagues. If you have any questions or suggestions regarding this article then please comment down below.

**Mac terminal loading animation using css**

![Mac terminal loading animation using css](https://res.cloudinary.com/freecodez/image/upload/v1701794742/images/encpcnqxknmosilpbhkw.webp)

For full source code visit : [https://freecodez.com/post/cv9uq8j](https://freecodez.com/post/cv9uq8j)


```html
<!-- https://freecodez.com -->
<div class="terminal-loader">
    <div class="terminal-header">
        <div class="terminal-controls">
            <div class="control close"></div>
            <div class="control minimize"></div>
            <div class="control maximize"></div>
        </div>
        <div class="terminal-title">Status</div>
    </div>
    <div class="content">
        <div class="text">Loading...</div>
    </div>
</div>
```

Source Code : [https://freecodez.com/post/cv9uq8j](https://freecodez.com/post/cv9uq8j)

For more such articles visit : [https://freecodez.com](https://freecodez.com/all)